Move SMB2 constants to a separate file
[Samba/fernandojvsilva.git] / librpc / gen_ndr / ndr_drsuapi.c
blob336f56f6ad211647bd42ffed222328169c161d58
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 switch (level) {
253 case 24: {
255 struct ndr_push *_ndr_info24;
256 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_info24, 4, -1));
257 NDR_CHECK(ndr_push_drsuapi_DsBindInfo24(_ndr_info24, NDR_SCALARS, &r->info24));
258 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info24, 4, -1));
260 break; }
262 case 28: {
264 struct ndr_push *_ndr_info28;
265 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_info28, 4, -1));
266 NDR_CHECK(ndr_push_drsuapi_DsBindInfo28(_ndr_info28, NDR_SCALARS, &r->info28));
267 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info28, 4, -1));
269 break; }
271 case 48: {
273 struct ndr_push *_ndr_info48;
274 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_info48, 4, -1));
275 NDR_CHECK(ndr_push_drsuapi_DsBindInfo48(_ndr_info48, NDR_SCALARS, &r->info48));
276 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info48, 4, -1));
278 break; }
280 default: {
282 struct ndr_push *_ndr_FallBack;
283 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_FallBack, 4, -1));
284 NDR_CHECK(ndr_push_drsuapi_DsBindInfoFallBack(_ndr_FallBack, NDR_SCALARS, &r->FallBack));
285 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_FallBack, 4, -1));
287 break; }
291 if (ndr_flags & NDR_BUFFERS) {
292 int level = ndr_push_get_switch_value(ndr, r);
293 switch (level) {
294 case 24:
295 break;
297 case 28:
298 break;
300 case 48:
301 break;
303 default:
304 break;
308 return NDR_ERR_SUCCESS;
311 static enum ndr_err_code ndr_pull_drsuapi_DsBindInfo(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsBindInfo *r)
313 int level;
314 level = ndr_pull_get_switch_value(ndr, r);
315 if (ndr_flags & NDR_SCALARS) {
316 switch (level) {
317 case 24: {
319 struct ndr_pull *_ndr_info24;
320 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_info24, 4, -1));
321 NDR_CHECK(ndr_pull_drsuapi_DsBindInfo24(_ndr_info24, NDR_SCALARS, &r->info24));
322 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_info24, 4, -1));
324 break; }
326 case 28: {
328 struct ndr_pull *_ndr_info28;
329 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_info28, 4, -1));
330 NDR_CHECK(ndr_pull_drsuapi_DsBindInfo28(_ndr_info28, NDR_SCALARS, &r->info28));
331 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_info28, 4, -1));
333 break; }
335 case 48: {
337 struct ndr_pull *_ndr_info48;
338 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_info48, 4, -1));
339 NDR_CHECK(ndr_pull_drsuapi_DsBindInfo48(_ndr_info48, NDR_SCALARS, &r->info48));
340 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_info48, 4, -1));
342 break; }
344 default: {
346 struct ndr_pull *_ndr_FallBack;
347 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_FallBack, 4, -1));
348 NDR_CHECK(ndr_pull_drsuapi_DsBindInfoFallBack(_ndr_FallBack, NDR_SCALARS, &r->FallBack));
349 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_FallBack, 4, -1));
351 break; }
355 if (ndr_flags & NDR_BUFFERS) {
356 switch (level) {
357 case 24:
358 break;
360 case 28:
361 break;
363 case 48:
364 break;
366 default:
367 break;
371 return NDR_ERR_SUCCESS;
374 _PUBLIC_ void ndr_print_drsuapi_DsBindInfo(struct ndr_print *ndr, const char *name, const union drsuapi_DsBindInfo *r)
376 int level;
377 level = ndr_print_get_switch_value(ndr, r);
378 ndr_print_union(ndr, name, level, "drsuapi_DsBindInfo");
379 switch (level) {
380 case 24:
381 ndr_print_drsuapi_DsBindInfo24(ndr, "info24", &r->info24);
382 break;
384 case 28:
385 ndr_print_drsuapi_DsBindInfo28(ndr, "info28", &r->info28);
386 break;
388 case 48:
389 ndr_print_drsuapi_DsBindInfo48(ndr, "info48", &r->info48);
390 break;
392 default:
393 ndr_print_drsuapi_DsBindInfoFallBack(ndr, "FallBack", &r->FallBack);
394 break;
399 static enum ndr_err_code ndr_push_drsuapi_DsBindInfoCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsBindInfoCtr *r)
401 if (ndr_flags & NDR_SCALARS) {
402 NDR_CHECK(ndr_push_align(ndr, 4));
403 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length));
404 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->info, r->length));
405 NDR_CHECK(ndr_push_drsuapi_DsBindInfo(ndr, NDR_SCALARS, &r->info));
407 if (ndr_flags & NDR_BUFFERS) {
409 return NDR_ERR_SUCCESS;
412 static enum ndr_err_code ndr_pull_drsuapi_DsBindInfoCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsBindInfoCtr *r)
414 if (ndr_flags & NDR_SCALARS) {
415 NDR_CHECK(ndr_pull_align(ndr, 4));
416 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length));
417 if (r->length < 1 || r->length > 10000) {
418 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
420 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->info, r->length));
421 NDR_CHECK(ndr_pull_drsuapi_DsBindInfo(ndr, NDR_SCALARS, &r->info));
423 if (ndr_flags & NDR_BUFFERS) {
425 return NDR_ERR_SUCCESS;
428 _PUBLIC_ void ndr_print_drsuapi_DsBindInfoCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsBindInfoCtr *r)
430 ndr_print_struct(ndr, name, "drsuapi_DsBindInfoCtr");
431 ndr->depth++;
432 ndr_print_uint32(ndr, "length", r->length);
433 ndr_print_set_switch_value(ndr, &r->info, r->length);
434 ndr_print_drsuapi_DsBindInfo(ndr, "info", &r->info);
435 ndr->depth--;
438 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectIdentifier(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectIdentifier *r)
440 if (ndr_flags & NDR_SCALARS) {
441 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m(r->dn) + 1));
442 NDR_CHECK(ndr_push_align(ndr, 4));
443 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_drsuapi_DsReplicaObjectIdentifier(r, ndr->iconv_convenience, ndr->flags) - 4));
444 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_dom_sid28(&r->sid, ndr->flags)));
445 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->guid));
446 NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_SCALARS, &r->sid));
447 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m(r->dn)));
448 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dn, strlen_m(r->dn) + 1, sizeof(uint16_t), CH_UTF16));
450 if (ndr_flags & NDR_BUFFERS) {
451 NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_BUFFERS, &r->sid));
453 return NDR_ERR_SUCCESS;
456 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectIdentifier(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectIdentifier *r)
458 if (ndr_flags & NDR_SCALARS) {
459 NDR_CHECK(ndr_pull_array_size(ndr, &r->dn));
460 NDR_CHECK(ndr_pull_align(ndr, 4));
461 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size));
462 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_sid));
463 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->guid));
464 NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_SCALARS, &r->sid));
465 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_dn));
466 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dn, ndr_get_array_size(ndr, &r->dn), sizeof(uint16_t), CH_UTF16));
467 if (r->dn) {
468 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->dn, r->__ndr_size_dn + 1));
471 if (ndr_flags & NDR_BUFFERS) {
472 NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_BUFFERS, &r->sid));
474 return NDR_ERR_SUCCESS;
477 _PUBLIC_ void ndr_print_drsuapi_DsReplicaObjectIdentifier(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjectIdentifier *r)
479 ndr_print_struct(ndr, name, "drsuapi_DsReplicaObjectIdentifier");
480 ndr->depth++;
481 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);
482 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);
483 ndr_print_GUID(ndr, "guid", &r->guid);
484 ndr_print_dom_sid28(ndr, "sid", &r->sid);
485 ndr_print_uint32(ndr, "__ndr_size_dn", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m(r->dn):r->__ndr_size_dn);
486 ndr_print_string(ndr, "dn", r->dn);
487 ndr->depth--;
490 _PUBLIC_ size_t ndr_size_drsuapi_DsReplicaObjectIdentifier(const struct drsuapi_DsReplicaObjectIdentifier *r, struct smb_iconv_convenience *ic, int flags)
492 return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier, ic);
495 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaSyncOptions(struct ndr_push *ndr, int ndr_flags, uint32_t r)
497 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
498 return NDR_ERR_SUCCESS;
501 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaSyncOptions(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
503 uint32_t v;
504 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
505 *r = v;
506 return NDR_ERR_SUCCESS;
509 _PUBLIC_ void ndr_print_drsuapi_DsReplicaSyncOptions(struct ndr_print *ndr, const char *name, uint32_t r)
511 ndr_print_uint32(ndr, name, r);
512 ndr->depth++;
513 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_ASYNCHRONOUS_OPERATION", DRSUAPI_DS_REPLICA_SYNC_ASYNCHRONOUS_OPERATION, r);
514 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_WRITEABLE", DRSUAPI_DS_REPLICA_SYNC_WRITEABLE, r);
515 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_PERIODIC", DRSUAPI_DS_REPLICA_SYNC_PERIODIC, r);
516 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_INTERSITE_MESSAGING", DRSUAPI_DS_REPLICA_SYNC_INTERSITE_MESSAGING, r);
517 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_ALL_SOURCES", DRSUAPI_DS_REPLICA_SYNC_ALL_SOURCES, r);
518 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_FULL", DRSUAPI_DS_REPLICA_SYNC_FULL, r);
519 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_URGENT", DRSUAPI_DS_REPLICA_SYNC_URGENT, r);
520 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_NO_DISCARD", DRSUAPI_DS_REPLICA_SYNC_NO_DISCARD, r);
521 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_FORCE", DRSUAPI_DS_REPLICA_SYNC_FORCE, r);
522 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_ADD_REFERENCE", DRSUAPI_DS_REPLICA_SYNC_ADD_REFERENCE, r);
523 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_NEVER_COMPLETED", DRSUAPI_DS_REPLICA_SYNC_NEVER_COMPLETED, r);
524 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_TWO_WAY", DRSUAPI_DS_REPLICA_SYNC_TWO_WAY, r);
525 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_NEVER_NOTIFY", DRSUAPI_DS_REPLICA_SYNC_NEVER_NOTIFY, r);
526 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_INITIAL", DRSUAPI_DS_REPLICA_SYNC_INITIAL, r);
527 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_USE_COMPRESSION", DRSUAPI_DS_REPLICA_SYNC_USE_COMPRESSION, r);
528 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_ABANDONED", DRSUAPI_DS_REPLICA_SYNC_ABANDONED, r);
529 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_INITIAL_IN_PROGRESS", DRSUAPI_DS_REPLICA_SYNC_INITIAL_IN_PROGRESS, r);
530 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_PARTIAL_ATTRIBUTE_SET", DRSUAPI_DS_REPLICA_SYNC_PARTIAL_ATTRIBUTE_SET, r);
531 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_REQUEUE", DRSUAPI_DS_REPLICA_SYNC_REQUEUE, r);
532 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_NOTIFICATION", DRSUAPI_DS_REPLICA_SYNC_NOTIFICATION, r);
533 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_ASYNCHRONOUS_REPLICA", DRSUAPI_DS_REPLICA_SYNC_ASYNCHRONOUS_REPLICA, r);
534 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_CRITICAL", DRSUAPI_DS_REPLICA_SYNC_CRITICAL, r);
535 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_FULL_IN_PROGRESS", DRSUAPI_DS_REPLICA_SYNC_FULL_IN_PROGRESS, r);
536 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_PREEMPTED", DRSUAPI_DS_REPLICA_SYNC_PREEMPTED, r);
537 ndr->depth--;
540 static enum ndr_err_code ndr_push_drsuapi_DsReplicaSyncRequest1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaSyncRequest1 *r)
542 if (ndr_flags & NDR_SCALARS) {
543 NDR_CHECK(ndr_push_align(ndr, 4));
544 NDR_CHECK(ndr_push_unique_ptr(ndr, r->naming_context));
545 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_guid));
547 uint32_t _flags_save_string = ndr->flags;
548 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
549 NDR_CHECK(ndr_push_unique_ptr(ndr, r->other_info));
550 ndr->flags = _flags_save_string;
552 NDR_CHECK(ndr_push_drsuapi_DsReplicaSyncOptions(ndr, NDR_SCALARS, r->options));
554 if (ndr_flags & NDR_BUFFERS) {
555 if (r->naming_context) {
556 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
559 uint32_t _flags_save_string = ndr->flags;
560 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
561 if (r->other_info) {
562 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->other_info));
564 ndr->flags = _flags_save_string;
567 return NDR_ERR_SUCCESS;
570 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaSyncRequest1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaSyncRequest1 *r)
572 uint32_t _ptr_naming_context;
573 TALLOC_CTX *_mem_save_naming_context_0;
574 uint32_t _ptr_other_info;
575 TALLOC_CTX *_mem_save_other_info_0;
576 if (ndr_flags & NDR_SCALARS) {
577 NDR_CHECK(ndr_pull_align(ndr, 4));
578 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_naming_context));
579 if (_ptr_naming_context) {
580 NDR_PULL_ALLOC(ndr, r->naming_context);
581 } else {
582 r->naming_context = NULL;
584 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_guid));
586 uint32_t _flags_save_string = ndr->flags;
587 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
588 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_other_info));
589 if (_ptr_other_info) {
590 NDR_PULL_ALLOC(ndr, r->other_info);
591 } else {
592 r->other_info = NULL;
594 ndr->flags = _flags_save_string;
596 NDR_CHECK(ndr_pull_drsuapi_DsReplicaSyncOptions(ndr, NDR_SCALARS, &r->options));
598 if (ndr_flags & NDR_BUFFERS) {
599 if (r->naming_context) {
600 _mem_save_naming_context_0 = NDR_PULL_GET_MEM_CTX(ndr);
601 NDR_PULL_SET_MEM_CTX(ndr, r->naming_context, 0);
602 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
603 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_naming_context_0, 0);
606 uint32_t _flags_save_string = ndr->flags;
607 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
608 if (r->other_info) {
609 _mem_save_other_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
610 NDR_PULL_SET_MEM_CTX(ndr, r->other_info, 0);
611 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->other_info));
612 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_other_info_0, 0);
614 ndr->flags = _flags_save_string;
617 return NDR_ERR_SUCCESS;
620 _PUBLIC_ void ndr_print_drsuapi_DsReplicaSyncRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaSyncRequest1 *r)
622 ndr_print_struct(ndr, name, "drsuapi_DsReplicaSyncRequest1");
623 ndr->depth++;
624 ndr_print_ptr(ndr, "naming_context", r->naming_context);
625 ndr->depth++;
626 if (r->naming_context) {
627 ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "naming_context", r->naming_context);
629 ndr->depth--;
630 ndr_print_GUID(ndr, "source_dsa_guid", &r->source_dsa_guid);
631 ndr_print_ptr(ndr, "other_info", r->other_info);
632 ndr->depth++;
633 if (r->other_info) {
634 ndr_print_string(ndr, "other_info", r->other_info);
636 ndr->depth--;
637 ndr_print_drsuapi_DsReplicaSyncOptions(ndr, "options", r->options);
638 ndr->depth--;
641 static enum ndr_err_code ndr_push_drsuapi_DsReplicaSyncRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsReplicaSyncRequest *r)
643 if (ndr_flags & NDR_SCALARS) {
644 int level = ndr_push_get_switch_value(ndr, r);
645 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
646 switch (level) {
647 case 1: {
648 NDR_CHECK(ndr_push_drsuapi_DsReplicaSyncRequest1(ndr, NDR_SCALARS, &r->req1));
649 break; }
651 default:
652 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
655 if (ndr_flags & NDR_BUFFERS) {
656 int level = ndr_push_get_switch_value(ndr, r);
657 switch (level) {
658 case 1:
659 NDR_CHECK(ndr_push_drsuapi_DsReplicaSyncRequest1(ndr, NDR_BUFFERS, &r->req1));
660 break;
662 default:
663 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
666 return NDR_ERR_SUCCESS;
669 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaSyncRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsReplicaSyncRequest *r)
671 int level;
672 int32_t _level;
673 level = ndr_pull_get_switch_value(ndr, r);
674 if (ndr_flags & NDR_SCALARS) {
675 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
676 if (_level != level) {
677 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
679 switch (level) {
680 case 1: {
681 NDR_CHECK(ndr_pull_drsuapi_DsReplicaSyncRequest1(ndr, NDR_SCALARS, &r->req1));
682 break; }
684 default:
685 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
688 if (ndr_flags & NDR_BUFFERS) {
689 switch (level) {
690 case 1:
691 NDR_CHECK(ndr_pull_drsuapi_DsReplicaSyncRequest1(ndr, NDR_BUFFERS, &r->req1));
692 break;
694 default:
695 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
698 return NDR_ERR_SUCCESS;
701 _PUBLIC_ void ndr_print_drsuapi_DsReplicaSyncRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsReplicaSyncRequest *r)
703 int level;
704 level = ndr_print_get_switch_value(ndr, r);
705 ndr_print_union(ndr, name, level, "drsuapi_DsReplicaSyncRequest");
706 switch (level) {
707 case 1:
708 ndr_print_drsuapi_DsReplicaSyncRequest1(ndr, "req1", &r->req1);
709 break;
711 default:
712 ndr_print_bad_level(ndr, name, level);
716 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaHighWaterMark(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaHighWaterMark *r)
718 if (ndr_flags & NDR_SCALARS) {
719 NDR_CHECK(ndr_push_align(ndr, 8));
720 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->tmp_highest_usn));
721 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->reserved_usn));
722 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->highest_usn));
724 if (ndr_flags & NDR_BUFFERS) {
726 return NDR_ERR_SUCCESS;
729 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaHighWaterMark(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaHighWaterMark *r)
731 if (ndr_flags & NDR_SCALARS) {
732 NDR_CHECK(ndr_pull_align(ndr, 8));
733 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->tmp_highest_usn));
734 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->reserved_usn));
735 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->highest_usn));
737 if (ndr_flags & NDR_BUFFERS) {
739 return NDR_ERR_SUCCESS;
742 _PUBLIC_ void ndr_print_drsuapi_DsReplicaHighWaterMark(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaHighWaterMark *r)
744 ndr_print_struct(ndr, name, "drsuapi_DsReplicaHighWaterMark");
745 ndr->depth++;
746 ndr_print_hyper(ndr, "tmp_highest_usn", r->tmp_highest_usn);
747 ndr_print_hyper(ndr, "reserved_usn", r->reserved_usn);
748 ndr_print_hyper(ndr, "highest_usn", r->highest_usn);
749 ndr->depth--;
752 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaCursor(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursor *r)
754 if (ndr_flags & NDR_SCALARS) {
755 NDR_CHECK(ndr_push_align(ndr, 8));
756 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
757 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->highest_usn));
759 if (ndr_flags & NDR_BUFFERS) {
761 return NDR_ERR_SUCCESS;
764 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursor(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursor *r)
766 if (ndr_flags & NDR_SCALARS) {
767 NDR_CHECK(ndr_pull_align(ndr, 8));
768 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
769 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->highest_usn));
771 if (ndr_flags & NDR_BUFFERS) {
773 return NDR_ERR_SUCCESS;
776 _PUBLIC_ void ndr_print_drsuapi_DsReplicaCursor(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursor *r)
778 ndr_print_struct(ndr, name, "drsuapi_DsReplicaCursor");
779 ndr->depth++;
780 ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id);
781 ndr_print_hyper(ndr, "highest_usn", r->highest_usn);
782 ndr->depth--;
785 static enum ndr_err_code ndr_push_drsuapi_DsReplicaCursorCtrEx(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursorCtrEx *r)
787 uint32_t cntr_cursors_0;
788 if (ndr_flags & NDR_SCALARS) {
789 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
790 NDR_CHECK(ndr_push_align(ndr, 8));
791 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 1));
792 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
793 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
794 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
795 for (cntr_cursors_0 = 0; cntr_cursors_0 < r->count; cntr_cursors_0++) {
796 NDR_CHECK(ndr_push_drsuapi_DsReplicaCursor(ndr, NDR_SCALARS, &r->cursors[cntr_cursors_0]));
799 if (ndr_flags & NDR_BUFFERS) {
801 return NDR_ERR_SUCCESS;
804 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursorCtrEx(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursorCtrEx *r)
806 uint32_t cntr_cursors_0;
807 TALLOC_CTX *_mem_save_cursors_0;
808 if (ndr_flags & NDR_SCALARS) {
809 NDR_CHECK(ndr_pull_array_size(ndr, &r->cursors));
810 NDR_CHECK(ndr_pull_align(ndr, 8));
811 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
812 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved1));
813 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
814 if (r->count > 0x100000) {
815 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
817 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved2));
818 NDR_PULL_ALLOC_N(ndr, r->cursors, ndr_get_array_size(ndr, &r->cursors));
819 _mem_save_cursors_0 = NDR_PULL_GET_MEM_CTX(ndr);
820 NDR_PULL_SET_MEM_CTX(ndr, r->cursors, 0);
821 for (cntr_cursors_0 = 0; cntr_cursors_0 < r->count; cntr_cursors_0++) {
822 NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursor(ndr, NDR_SCALARS, &r->cursors[cntr_cursors_0]));
824 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_cursors_0, 0);
825 if (r->cursors) {
826 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->cursors, r->count));
829 if (ndr_flags & NDR_BUFFERS) {
831 return NDR_ERR_SUCCESS;
834 _PUBLIC_ void ndr_print_drsuapi_DsReplicaCursorCtrEx(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursorCtrEx *r)
836 uint32_t cntr_cursors_0;
837 ndr_print_struct(ndr, name, "drsuapi_DsReplicaCursorCtrEx");
838 ndr->depth++;
839 ndr_print_uint32(ndr, "version", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?1:r->version);
840 ndr_print_uint32(ndr, "reserved1", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved1);
841 ndr_print_uint32(ndr, "count", r->count);
842 ndr_print_uint32(ndr, "reserved2", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved2);
843 ndr->print(ndr, "%s: ARRAY(%d)", "cursors", (int)r->count);
844 ndr->depth++;
845 for (cntr_cursors_0=0;cntr_cursors_0<r->count;cntr_cursors_0++) {
846 char *idx_0=NULL;
847 if (asprintf(&idx_0, "[%d]", cntr_cursors_0) != -1) {
848 ndr_print_drsuapi_DsReplicaCursor(ndr, "cursors", &r->cursors[cntr_cursors_0]);
849 free(idx_0);
852 ndr->depth--;
853 ndr->depth--;
856 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaNeighbourFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
858 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
859 return NDR_ERR_SUCCESS;
862 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaNeighbourFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
864 uint32_t v;
865 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
866 *r = v;
867 return NDR_ERR_SUCCESS;
870 _PUBLIC_ void ndr_print_drsuapi_DsReplicaNeighbourFlags(struct ndr_print *ndr, const char *name, uint32_t r)
872 ndr_print_uint32(ndr, name, r);
873 ndr->depth++;
874 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_WRITEABLE", DRSUAPI_DS_REPLICA_NEIGHBOUR_WRITEABLE, r);
875 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_SYNC_ON_STARTUP", DRSUAPI_DS_REPLICA_NEIGHBOUR_SYNC_ON_STARTUP, r);
876 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_DO_SCHEDULED_SYNCS", DRSUAPI_DS_REPLICA_NEIGHBOUR_DO_SCHEDULED_SYNCS, r);
877 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);
878 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_TWO_WAY_SYNC", DRSUAPI_DS_REPLICA_NEIGHBOUR_TWO_WAY_SYNC, r);
879 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_RETURN_OBJECT_PARENTS", DRSUAPI_DS_REPLICA_NEIGHBOUR_RETURN_OBJECT_PARENTS, r);
880 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_FULL_IN_PROGRESS", DRSUAPI_DS_REPLICA_NEIGHBOUR_FULL_IN_PROGRESS, r);
881 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_FULL_NEXT_PACKET", DRSUAPI_DS_REPLICA_NEIGHBOUR_FULL_NEXT_PACKET, r);
882 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_NEVER_SYNCED", DRSUAPI_DS_REPLICA_NEIGHBOUR_NEVER_SYNCED, r);
883 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_PREEMPTED", DRSUAPI_DS_REPLICA_NEIGHBOUR_PREEMPTED, r);
884 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_IGNORE_CHANGE_NOTIFICATIONS", DRSUAPI_DS_REPLICA_NEIGHBOUR_IGNORE_CHANGE_NOTIFICATIONS, r);
885 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_DISABLE_SCHEDULED_SYNC", DRSUAPI_DS_REPLICA_NEIGHBOUR_DISABLE_SCHEDULED_SYNC, r);
886 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_COMPRESS_CHANGES", DRSUAPI_DS_REPLICA_NEIGHBOUR_COMPRESS_CHANGES, r);
887 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_NO_CHANGE_NOTIFICATIONS", DRSUAPI_DS_REPLICA_NEIGHBOUR_NO_CHANGE_NOTIFICATIONS, r);
888 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_PARTIAL_ATTRIBUTE_SET", DRSUAPI_DS_REPLICA_NEIGHBOUR_PARTIAL_ATTRIBUTE_SET, r);
889 ndr->depth--;
892 static enum ndr_err_code ndr_push_drsuapi_DsExtendedOperation(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsExtendedOperation r)
895 uint32_t _flags_save_ENUM = ndr->flags;
896 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
897 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
898 ndr->flags = _flags_save_ENUM;
900 return NDR_ERR_SUCCESS;
903 static enum ndr_err_code ndr_pull_drsuapi_DsExtendedOperation(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsExtendedOperation *r)
905 uint32_t v;
907 uint32_t _flags_save_ENUM = ndr->flags;
908 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
909 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
910 *r = v;
911 ndr->flags = _flags_save_ENUM;
913 return NDR_ERR_SUCCESS;
916 _PUBLIC_ void ndr_print_drsuapi_DsExtendedOperation(struct ndr_print *ndr, const char *name, enum drsuapi_DsExtendedOperation r)
918 const char *val = NULL;
921 uint32_t _flags_save_ENUM = ndr->flags;
922 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
923 switch (r) {
924 case DRSUAPI_EXOP_NONE: val = "DRSUAPI_EXOP_NONE"; break;
925 case DRSUAPI_EXOP_FSMO_REQ_ROLE: val = "DRSUAPI_EXOP_FSMO_REQ_ROLE"; break;
926 case DRSUAPI_EXOP_FSMO_RID_ALLOC: val = "DRSUAPI_EXOP_FSMO_RID_ALLOC"; break;
927 case DRSUAPI_EXOP_FSMO_RID_REQ_ROLE: val = "DRSUAPI_EXOP_FSMO_RID_REQ_ROLE"; break;
928 case DRSUAPI_EXOP_FSMO_REQ_PDC: val = "DRSUAPI_EXOP_FSMO_REQ_PDC"; break;
929 case DRSUAPI_EXOP_FSMO_ABANDON_ROLE: val = "DRSUAPI_EXOP_FSMO_ABANDON_ROLE"; break;
930 case DRSUAPI_EXOP_REPL_OBJ: val = "DRSUAPI_EXOP_REPL_OBJ"; break;
931 case DRSUAPI_EXOP_REPL_SECRET: val = "DRSUAPI_EXOP_REPL_SECRET"; break;
933 ndr_print_enum(ndr, name, "ENUM", val, r);
934 ndr->flags = _flags_save_ENUM;
938 static enum ndr_err_code ndr_push_drsuapi_DsExtendedError(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsExtendedError r)
941 uint32_t _flags_save_ENUM = ndr->flags;
942 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
943 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
944 ndr->flags = _flags_save_ENUM;
946 return NDR_ERR_SUCCESS;
949 static enum ndr_err_code ndr_pull_drsuapi_DsExtendedError(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsExtendedError *r)
951 uint32_t v;
953 uint32_t _flags_save_ENUM = ndr->flags;
954 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
955 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
956 *r = v;
957 ndr->flags = _flags_save_ENUM;
959 return NDR_ERR_SUCCESS;
962 _PUBLIC_ void ndr_print_drsuapi_DsExtendedError(struct ndr_print *ndr, const char *name, enum drsuapi_DsExtendedError r)
964 const char *val = NULL;
967 uint32_t _flags_save_ENUM = ndr->flags;
968 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
969 switch (r) {
970 case DRSUAPI_EXOP_ERR_NONE: val = "DRSUAPI_EXOP_ERR_NONE"; break;
971 case DRSUAPI_EXOP_ERR_SUCCESS: val = "DRSUAPI_EXOP_ERR_SUCCESS"; break;
972 case DRSUAPI_EXOP_ERR_UNKNOWN_OP: val = "DRSUAPI_EXOP_ERR_UNKNOWN_OP"; break;
973 case DRSUAPI_EXOP_ERR_FSMO_NOT_OWNER: val = "DRSUAPI_EXOP_ERR_FSMO_NOT_OWNER"; break;
974 case DRSUAPI_EXOP_ERR_UPDATE_ERR: val = "DRSUAPI_EXOP_ERR_UPDATE_ERR"; break;
975 case DRSUAPI_EXOP_ERR_EXCEPTION: val = "DRSUAPI_EXOP_ERR_EXCEPTION"; break;
976 case DRSUAPI_EXOP_ERR_UNKNOWN_CALLER: val = "DRSUAPI_EXOP_ERR_UNKNOWN_CALLER"; break;
977 case DRSUAPI_EXOP_ERR_RID_ALLOC: val = "DRSUAPI_EXOP_ERR_RID_ALLOC"; break;
978 case DRSUAPI_EXOP_ERR_FSMO_OWNER_DELETED: val = "DRSUAPI_EXOP_ERR_FSMO_OWNER_DELETED"; break;
979 case DRSUAPI_EXOP_ERR_FMSO_PENDING_OP: val = "DRSUAPI_EXOP_ERR_FMSO_PENDING_OP"; break;
980 case DRSUAPI_EXOP_ERR_MISMATCH: val = "DRSUAPI_EXOP_ERR_MISMATCH"; break;
981 case DRSUAPI_EXOP_ERR_COULDNT_CONTACT: val = "DRSUAPI_EXOP_ERR_COULDNT_CONTACT"; break;
982 case DRSUAPI_EXOP_ERR_FSMO_REFUSING_ROLES: val = "DRSUAPI_EXOP_ERR_FSMO_REFUSING_ROLES"; break;
983 case DRSUAPI_EXOP_ERR_DIR_ERROR: val = "DRSUAPI_EXOP_ERR_DIR_ERROR"; break;
984 case DRSUAPI_EXOP_ERR_FSMO_MISSING_SETTINGS: val = "DRSUAPI_EXOP_ERR_FSMO_MISSING_SETTINGS"; break;
985 case DRSUAPI_EXOP_ERR_ACCESS_DENIED: val = "DRSUAPI_EXOP_ERR_ACCESS_DENIED"; break;
986 case DRSUAPI_EXOP_ERR_PARAM_ERROR: val = "DRSUAPI_EXOP_ERR_PARAM_ERROR"; break;
988 ndr_print_enum(ndr, name, "ENUM", val, r);
989 ndr->flags = _flags_save_ENUM;
993 static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesRequest5(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesRequest5 *r)
995 if (ndr_flags & NDR_SCALARS) {
996 NDR_CHECK(ndr_push_align(ndr, 8));
997 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->destination_dsa_guid));
998 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
999 if (r->naming_context == NULL) {
1000 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1002 NDR_CHECK(ndr_push_ref_ptr(ndr));
1003 NDR_CHECK(ndr_push_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->highwatermark));
1004 NDR_CHECK(ndr_push_unique_ptr(ndr, r->uptodateness_vector));
1005 NDR_CHECK(ndr_push_drsuapi_DsReplicaNeighbourFlags(ndr, NDR_SCALARS, r->replica_flags));
1006 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_object_count));
1007 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_ndr_size));
1008 NDR_CHECK(ndr_push_drsuapi_DsExtendedOperation(ndr, NDR_SCALARS, r->extended_op));
1009 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->fsmo_info));
1011 if (ndr_flags & NDR_BUFFERS) {
1012 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
1013 if (r->uptodateness_vector) {
1014 NDR_CHECK(ndr_push_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->uptodateness_vector));
1017 return NDR_ERR_SUCCESS;
1020 static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesRequest5(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesRequest5 *r)
1022 uint32_t _ptr_naming_context;
1023 TALLOC_CTX *_mem_save_naming_context_0;
1024 uint32_t _ptr_uptodateness_vector;
1025 TALLOC_CTX *_mem_save_uptodateness_vector_0;
1026 if (ndr_flags & NDR_SCALARS) {
1027 NDR_CHECK(ndr_pull_align(ndr, 8));
1028 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->destination_dsa_guid));
1029 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
1030 NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_naming_context));
1031 if (_ptr_naming_context) {
1032 NDR_PULL_ALLOC(ndr, r->naming_context);
1033 } else {
1034 r->naming_context = NULL;
1036 NDR_CHECK(ndr_pull_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->highwatermark));
1037 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_uptodateness_vector));
1038 if (_ptr_uptodateness_vector) {
1039 NDR_PULL_ALLOC(ndr, r->uptodateness_vector);
1040 } else {
1041 r->uptodateness_vector = NULL;
1043 NDR_CHECK(ndr_pull_drsuapi_DsReplicaNeighbourFlags(ndr, NDR_SCALARS, &r->replica_flags));
1044 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_object_count));
1045 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_ndr_size));
1046 NDR_CHECK(ndr_pull_drsuapi_DsExtendedOperation(ndr, NDR_SCALARS, &r->extended_op));
1047 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->fsmo_info));
1049 if (ndr_flags & NDR_BUFFERS) {
1050 _mem_save_naming_context_0 = NDR_PULL_GET_MEM_CTX(ndr);
1051 NDR_PULL_SET_MEM_CTX(ndr, r->naming_context, 0);
1052 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
1053 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_naming_context_0, 0);
1054 if (r->uptodateness_vector) {
1055 _mem_save_uptodateness_vector_0 = NDR_PULL_GET_MEM_CTX(ndr);
1056 NDR_PULL_SET_MEM_CTX(ndr, r->uptodateness_vector, 0);
1057 NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->uptodateness_vector));
1058 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_uptodateness_vector_0, 0);
1061 return NDR_ERR_SUCCESS;
1064 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesRequest5(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesRequest5 *r)
1066 ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesRequest5");
1067 ndr->depth++;
1068 ndr_print_GUID(ndr, "destination_dsa_guid", &r->destination_dsa_guid);
1069 ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id);
1070 ndr_print_ptr(ndr, "naming_context", r->naming_context);
1071 ndr->depth++;
1072 ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "naming_context", r->naming_context);
1073 ndr->depth--;
1074 ndr_print_drsuapi_DsReplicaHighWaterMark(ndr, "highwatermark", &r->highwatermark);
1075 ndr_print_ptr(ndr, "uptodateness_vector", r->uptodateness_vector);
1076 ndr->depth++;
1077 if (r->uptodateness_vector) {
1078 ndr_print_drsuapi_DsReplicaCursorCtrEx(ndr, "uptodateness_vector", r->uptodateness_vector);
1080 ndr->depth--;
1081 ndr_print_drsuapi_DsReplicaNeighbourFlags(ndr, "replica_flags", r->replica_flags);
1082 ndr_print_uint32(ndr, "max_object_count", r->max_object_count);
1083 ndr_print_uint32(ndr, "max_ndr_size", r->max_ndr_size);
1084 ndr_print_drsuapi_DsExtendedOperation(ndr, "extended_op", r->extended_op);
1085 ndr_print_hyper(ndr, "fsmo_info", r->fsmo_info);
1086 ndr->depth--;
1089 _PUBLIC_ void ndr_print_drsuapi_DsReplicaOID(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaOID *r)
1091 ndr_print_struct(ndr, name, "drsuapi_DsReplicaOID");
1092 ndr->depth++;
1093 ndr_print_uint32(ndr, "__ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_drsuapi_DsReplicaOID_oid(r->oid, 0):r->__ndr_size);
1094 ndr_print_ptr(ndr, "oid", r->oid);
1095 ndr->depth++;
1096 if (r->oid) {
1097 ndr_print_string(ndr, "oid", r->oid);
1099 ndr->depth--;
1100 ndr->depth--;
1103 static enum ndr_err_code ndr_push_drsuapi_DsReplicaOIDMapping(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaOIDMapping *r)
1105 if (ndr_flags & NDR_SCALARS) {
1106 NDR_CHECK(ndr_push_align(ndr, 4));
1107 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->id_prefix));
1108 NDR_CHECK(ndr_push_drsuapi_DsReplicaOID(ndr, NDR_SCALARS, &r->oid));
1110 if (ndr_flags & NDR_BUFFERS) {
1111 NDR_CHECK(ndr_push_drsuapi_DsReplicaOID(ndr, NDR_BUFFERS, &r->oid));
1113 return NDR_ERR_SUCCESS;
1116 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaOIDMapping(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaOIDMapping *r)
1118 if (ndr_flags & NDR_SCALARS) {
1119 NDR_CHECK(ndr_pull_align(ndr, 4));
1120 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->id_prefix));
1121 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOID(ndr, NDR_SCALARS, &r->oid));
1123 if (ndr_flags & NDR_BUFFERS) {
1124 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOID(ndr, NDR_BUFFERS, &r->oid));
1126 return NDR_ERR_SUCCESS;
1129 _PUBLIC_ void ndr_print_drsuapi_DsReplicaOIDMapping(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaOIDMapping *r)
1131 ndr_print_struct(ndr, name, "drsuapi_DsReplicaOIDMapping");
1132 ndr->depth++;
1133 ndr_print_uint32(ndr, "id_prefix", r->id_prefix);
1134 ndr_print_drsuapi_DsReplicaOID(ndr, "oid", &r->oid);
1135 ndr->depth--;
1138 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaOIDMapping_Ctr *r)
1140 uint32_t cntr_mappings_1;
1141 if (ndr_flags & NDR_SCALARS) {
1142 NDR_CHECK(ndr_push_align(ndr, 4));
1143 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_mappings));
1144 NDR_CHECK(ndr_push_unique_ptr(ndr, r->mappings));
1146 if (ndr_flags & NDR_BUFFERS) {
1147 if (r->mappings) {
1148 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_mappings));
1149 for (cntr_mappings_1 = 0; cntr_mappings_1 < r->num_mappings; cntr_mappings_1++) {
1150 NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping(ndr, NDR_SCALARS, &r->mappings[cntr_mappings_1]));
1152 for (cntr_mappings_1 = 0; cntr_mappings_1 < r->num_mappings; cntr_mappings_1++) {
1153 NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping(ndr, NDR_BUFFERS, &r->mappings[cntr_mappings_1]));
1157 return NDR_ERR_SUCCESS;
1160 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaOIDMapping_Ctr *r)
1162 uint32_t _ptr_mappings;
1163 uint32_t cntr_mappings_1;
1164 TALLOC_CTX *_mem_save_mappings_0;
1165 TALLOC_CTX *_mem_save_mappings_1;
1166 if (ndr_flags & NDR_SCALARS) {
1167 NDR_CHECK(ndr_pull_align(ndr, 4));
1168 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_mappings));
1169 if (r->num_mappings > 0x100000) {
1170 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
1172 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_mappings));
1173 if (_ptr_mappings) {
1174 NDR_PULL_ALLOC(ndr, r->mappings);
1175 } else {
1176 r->mappings = NULL;
1179 if (ndr_flags & NDR_BUFFERS) {
1180 if (r->mappings) {
1181 _mem_save_mappings_0 = NDR_PULL_GET_MEM_CTX(ndr);
1182 NDR_PULL_SET_MEM_CTX(ndr, r->mappings, 0);
1183 NDR_CHECK(ndr_pull_array_size(ndr, &r->mappings));
1184 NDR_PULL_ALLOC_N(ndr, r->mappings, ndr_get_array_size(ndr, &r->mappings));
1185 _mem_save_mappings_1 = NDR_PULL_GET_MEM_CTX(ndr);
1186 NDR_PULL_SET_MEM_CTX(ndr, r->mappings, 0);
1187 for (cntr_mappings_1 = 0; cntr_mappings_1 < r->num_mappings; cntr_mappings_1++) {
1188 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping(ndr, NDR_SCALARS, &r->mappings[cntr_mappings_1]));
1190 for (cntr_mappings_1 = 0; cntr_mappings_1 < r->num_mappings; cntr_mappings_1++) {
1191 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping(ndr, NDR_BUFFERS, &r->mappings[cntr_mappings_1]));
1193 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_mappings_1, 0);
1194 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_mappings_0, 0);
1196 if (r->mappings) {
1197 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->mappings, r->num_mappings));
1200 return NDR_ERR_SUCCESS;
1203 _PUBLIC_ void ndr_print_drsuapi_DsReplicaOIDMapping_Ctr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaOIDMapping_Ctr *r)
1205 uint32_t cntr_mappings_1;
1206 ndr_print_struct(ndr, name, "drsuapi_DsReplicaOIDMapping_Ctr");
1207 ndr->depth++;
1208 ndr_print_uint32(ndr, "num_mappings", r->num_mappings);
1209 ndr_print_ptr(ndr, "mappings", r->mappings);
1210 ndr->depth++;
1211 if (r->mappings) {
1212 ndr->print(ndr, "%s: ARRAY(%d)", "mappings", (int)r->num_mappings);
1213 ndr->depth++;
1214 for (cntr_mappings_1=0;cntr_mappings_1<r->num_mappings;cntr_mappings_1++) {
1215 char *idx_1=NULL;
1216 if (asprintf(&idx_1, "[%d]", cntr_mappings_1) != -1) {
1217 ndr_print_drsuapi_DsReplicaOIDMapping(ndr, "mappings", &r->mappings[cntr_mappings_1]);
1218 free(idx_1);
1221 ndr->depth--;
1223 ndr->depth--;
1224 ndr->depth--;
1227 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsAttributeId(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsAttributeId r)
1230 uint32_t _flags_save_ENUM = ndr->flags;
1231 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1232 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
1233 ndr->flags = _flags_save_ENUM;
1235 return NDR_ERR_SUCCESS;
1238 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsAttributeId(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsAttributeId *r)
1240 uint32_t v;
1242 uint32_t _flags_save_ENUM = ndr->flags;
1243 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1244 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
1245 *r = v;
1246 ndr->flags = _flags_save_ENUM;
1248 return NDR_ERR_SUCCESS;
1251 _PUBLIC_ void ndr_print_drsuapi_DsAttributeId(struct ndr_print *ndr, const char *name, enum drsuapi_DsAttributeId r)
1253 const char *val = NULL;
1256 uint32_t _flags_save_ENUM = ndr->flags;
1257 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1258 switch (r) {
1259 case DRSUAPI_ATTRIBUTE_objectClass: val = "DRSUAPI_ATTRIBUTE_objectClass"; break;
1260 case DRSUAPI_ATTRIBUTE_description: val = "DRSUAPI_ATTRIBUTE_description"; break;
1261 case DRSUAPI_ATTRIBUTE_member: val = "DRSUAPI_ATTRIBUTE_member"; break;
1262 case DRSUAPI_ATTRIBUTE_instanceType: val = "DRSUAPI_ATTRIBUTE_instanceType"; break;
1263 case DRSUAPI_ATTRIBUTE_whenCreated: val = "DRSUAPI_ATTRIBUTE_whenCreated"; break;
1264 case DRSUAPI_ATTRIBUTE_hasMasterNCs: val = "DRSUAPI_ATTRIBUTE_hasMasterNCs"; break;
1265 case DRSUAPI_ATTRIBUTE_governsID: val = "DRSUAPI_ATTRIBUTE_governsID"; break;
1266 case DRSUAPI_ATTRIBUTE_attributeID: val = "DRSUAPI_ATTRIBUTE_attributeID"; break;
1267 case DRSUAPI_ATTRIBUTE_attributeSyntax: val = "DRSUAPI_ATTRIBUTE_attributeSyntax"; break;
1268 case DRSUAPI_ATTRIBUTE_isSingleValued: val = "DRSUAPI_ATTRIBUTE_isSingleValued"; break;
1269 case DRSUAPI_ATTRIBUTE_rangeLower: val = "DRSUAPI_ATTRIBUTE_rangeLower"; break;
1270 case DRSUAPI_ATTRIBUTE_rangeUpper: val = "DRSUAPI_ATTRIBUTE_rangeUpper"; break;
1271 case DRSUAPI_ATTRIBUTE_dMDLocation: val = "DRSUAPI_ATTRIBUTE_dMDLocation"; break;
1272 case DRSUAPI_ATTRIBUTE_objectVersion: val = "DRSUAPI_ATTRIBUTE_objectVersion"; break;
1273 case DRSUAPI_ATTRIBUTE_invocationId: val = "DRSUAPI_ATTRIBUTE_invocationId"; break;
1274 case DRSUAPI_ATTRIBUTE_showInAdvancedViewOnly: val = "DRSUAPI_ATTRIBUTE_showInAdvancedViewOnly"; break;
1275 case DRSUAPI_ATTRIBUTE_adminDisplayName: val = "DRSUAPI_ATTRIBUTE_adminDisplayName"; break;
1276 case DRSUAPI_ATTRIBUTE_adminDescription: val = "DRSUAPI_ATTRIBUTE_adminDescription"; break;
1277 case DRSUAPI_ATTRIBUTE_oMSyntax: val = "DRSUAPI_ATTRIBUTE_oMSyntax"; break;
1278 case DRSUAPI_ATTRIBUTE_ntSecurityDescriptor: val = "DRSUAPI_ATTRIBUTE_ntSecurityDescriptor"; break;
1279 case DRSUAPI_ATTRIBUTE_searchFlags: val = "DRSUAPI_ATTRIBUTE_searchFlags"; break;
1280 case DRSUAPI_ATTRIBUTE_lDAPDisplayName: val = "DRSUAPI_ATTRIBUTE_lDAPDisplayName"; break;
1281 case DRSUAPI_ATTRIBUTE_name: val = "DRSUAPI_ATTRIBUTE_name"; break;
1282 case DRSUAPI_ATTRIBUTE_userAccountControl: val = "DRSUAPI_ATTRIBUTE_userAccountControl"; break;
1283 case DRSUAPI_ATTRIBUTE_currentValue: val = "DRSUAPI_ATTRIBUTE_currentValue"; break;
1284 case DRSUAPI_ATTRIBUTE_homeDirectory: val = "DRSUAPI_ATTRIBUTE_homeDirectory"; break;
1285 case DRSUAPI_ATTRIBUTE_homeDrive: val = "DRSUAPI_ATTRIBUTE_homeDrive"; break;
1286 case DRSUAPI_ATTRIBUTE_scriptPath: val = "DRSUAPI_ATTRIBUTE_scriptPath"; break;
1287 case DRSUAPI_ATTRIBUTE_profilePath: val = "DRSUAPI_ATTRIBUTE_profilePath"; break;
1288 case DRSUAPI_ATTRIBUTE_objectSid: val = "DRSUAPI_ATTRIBUTE_objectSid"; break;
1289 case DRSUAPI_ATTRIBUTE_schemaIDGUID: val = "DRSUAPI_ATTRIBUTE_schemaIDGUID"; break;
1290 case DRSUAPI_ATTRIBUTE_dBCSPwd: val = "DRSUAPI_ATTRIBUTE_dBCSPwd"; break;
1291 case DRSUAPI_ATTRIBUTE_logonHours: val = "DRSUAPI_ATTRIBUTE_logonHours"; break;
1292 case DRSUAPI_ATTRIBUTE_userWorkstations: val = "DRSUAPI_ATTRIBUTE_userWorkstations"; break;
1293 case DRSUAPI_ATTRIBUTE_unicodePwd: val = "DRSUAPI_ATTRIBUTE_unicodePwd"; break;
1294 case DRSUAPI_ATTRIBUTE_ntPwdHistory: val = "DRSUAPI_ATTRIBUTE_ntPwdHistory"; break;
1295 case DRSUAPI_ATTRIBUTE_priorValue: val = "DRSUAPI_ATTRIBUTE_priorValue"; break;
1296 case DRSUAPI_ATTRIBUTE_supplementalCredentials: val = "DRSUAPI_ATTRIBUTE_supplementalCredentials"; break;
1297 case DRSUAPI_ATTRIBUTE_trustAuthIncoming: val = "DRSUAPI_ATTRIBUTE_trustAuthIncoming"; break;
1298 case DRSUAPI_ATTRIBUTE_trustAuthOutgoing: val = "DRSUAPI_ATTRIBUTE_trustAuthOutgoing"; break;
1299 case DRSUAPI_ATTRIBUTE_lmPwdHistory: val = "DRSUAPI_ATTRIBUTE_lmPwdHistory"; break;
1300 case DRSUAPI_ATTRIBUTE_sAMAccountName: val = "DRSUAPI_ATTRIBUTE_sAMAccountName"; break;
1301 case DRSUAPI_ATTRIBUTE_sAMAccountType: val = "DRSUAPI_ATTRIBUTE_sAMAccountType"; break;
1302 case DRSUAPI_ATTRIBUTE_fSMORoleOwner: val = "DRSUAPI_ATTRIBUTE_fSMORoleOwner"; break;
1303 case DRSUAPI_ATTRIBUTE_systemFlags: val = "DRSUAPI_ATTRIBUTE_systemFlags"; break;
1304 case DRSUAPI_ATTRIBUTE_serverReference: val = "DRSUAPI_ATTRIBUTE_serverReference"; break;
1305 case DRSUAPI_ATTRIBUTE_serverReferenceBL: val = "DRSUAPI_ATTRIBUTE_serverReferenceBL"; break;
1306 case DRSUAPI_ATTRIBUTE_initialAuthIncoming: val = "DRSUAPI_ATTRIBUTE_initialAuthIncoming"; break;
1307 case DRSUAPI_ATTRIBUTE_initialAuthOutgoing: val = "DRSUAPI_ATTRIBUTE_initialAuthOutgoing"; break;
1308 case DRSUAPI_ATTRIBUTE_wellKnownObjects: val = "DRSUAPI_ATTRIBUTE_wellKnownObjects"; break;
1309 case DRSUAPI_ATTRIBUTE_dNSHostName: val = "DRSUAPI_ATTRIBUTE_dNSHostName"; break;
1310 case DRSUAPI_ATTRIBUTE_isMemberOfPartialAttributeSet: val = "DRSUAPI_ATTRIBUTE_isMemberOfPartialAttributeSet"; break;
1311 case DRSUAPI_ATTRIBUTE_userPrincipalName: val = "DRSUAPI_ATTRIBUTE_userPrincipalName"; break;
1312 case DRSUAPI_ATTRIBUTE_groupType: val = "DRSUAPI_ATTRIBUTE_groupType"; break;
1313 case DRSUAPI_ATTRIBUTE_servicePrincipalName: val = "DRSUAPI_ATTRIBUTE_servicePrincipalName"; break;
1314 case DRSUAPI_ATTRIBUTE_objectCategory: val = "DRSUAPI_ATTRIBUTE_objectCategory"; break;
1315 case DRSUAPI_ATTRIBUTE_gPLink: val = "DRSUAPI_ATTRIBUTE_gPLink"; break;
1316 case DRSUAPI_ATTRIBUTE_msDS_Behavior_Version: val = "DRSUAPI_ATTRIBUTE_msDS_Behavior_Version"; break;
1317 case DRSUAPI_ATTRIBUTE_msDS_KeyVersionNumber: val = "DRSUAPI_ATTRIBUTE_msDS_KeyVersionNumber"; break;
1318 case DRSUAPI_ATTRIBUTE_msDS_HasDomainNCs: val = "DRSUAPI_ATTRIBUTE_msDS_HasDomainNCs"; break;
1319 case DRSUAPI_ATTRIBUTE_msDS_hasMasterNCs: val = "DRSUAPI_ATTRIBUTE_msDS_hasMasterNCs"; break;
1321 ndr_print_enum(ndr, name, "ENUM", val, r);
1322 ndr->flags = _flags_save_ENUM;
1326 static enum ndr_err_code ndr_push_drsuapi_DsPartialAttributeSet(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsPartialAttributeSet *r)
1328 uint32_t cntr_attids_0;
1329 if (ndr_flags & NDR_SCALARS) {
1330 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_attids));
1331 NDR_CHECK(ndr_push_align(ndr, 4));
1332 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 1));
1333 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
1334 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_attids));
1335 for (cntr_attids_0 = 0; cntr_attids_0 < r->num_attids; cntr_attids_0++) {
1336 NDR_CHECK(ndr_push_drsuapi_DsAttributeId(ndr, NDR_SCALARS, r->attids[cntr_attids_0]));
1339 if (ndr_flags & NDR_BUFFERS) {
1341 return NDR_ERR_SUCCESS;
1344 static enum ndr_err_code ndr_pull_drsuapi_DsPartialAttributeSet(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsPartialAttributeSet *r)
1346 uint32_t cntr_attids_0;
1347 TALLOC_CTX *_mem_save_attids_0;
1348 if (ndr_flags & NDR_SCALARS) {
1349 NDR_CHECK(ndr_pull_array_size(ndr, &r->attids));
1350 NDR_CHECK(ndr_pull_align(ndr, 4));
1351 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
1352 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved1));
1353 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_attids));
1354 if (r->num_attids < 1 || r->num_attids > 0x100000) {
1355 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
1357 NDR_PULL_ALLOC_N(ndr, r->attids, ndr_get_array_size(ndr, &r->attids));
1358 _mem_save_attids_0 = NDR_PULL_GET_MEM_CTX(ndr);
1359 NDR_PULL_SET_MEM_CTX(ndr, r->attids, 0);
1360 for (cntr_attids_0 = 0; cntr_attids_0 < r->num_attids; cntr_attids_0++) {
1361 NDR_CHECK(ndr_pull_drsuapi_DsAttributeId(ndr, NDR_SCALARS, &r->attids[cntr_attids_0]));
1363 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attids_0, 0);
1364 if (r->attids) {
1365 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->attids, r->num_attids));
1368 if (ndr_flags & NDR_BUFFERS) {
1370 return NDR_ERR_SUCCESS;
1373 _PUBLIC_ void ndr_print_drsuapi_DsPartialAttributeSet(struct ndr_print *ndr, const char *name, const struct drsuapi_DsPartialAttributeSet *r)
1375 uint32_t cntr_attids_0;
1376 ndr_print_struct(ndr, name, "drsuapi_DsPartialAttributeSet");
1377 ndr->depth++;
1378 ndr_print_uint32(ndr, "version", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?1:r->version);
1379 ndr_print_uint32(ndr, "reserved1", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved1);
1380 ndr_print_uint32(ndr, "num_attids", r->num_attids);
1381 ndr->print(ndr, "%s: ARRAY(%d)", "attids", (int)r->num_attids);
1382 ndr->depth++;
1383 for (cntr_attids_0=0;cntr_attids_0<r->num_attids;cntr_attids_0++) {
1384 char *idx_0=NULL;
1385 if (asprintf(&idx_0, "[%d]", cntr_attids_0) != -1) {
1386 ndr_print_drsuapi_DsAttributeId(ndr, "attids", r->attids[cntr_attids_0]);
1387 free(idx_0);
1390 ndr->depth--;
1391 ndr->depth--;
1394 static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesRequest8(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesRequest8 *r)
1396 if (ndr_flags & NDR_SCALARS) {
1397 NDR_CHECK(ndr_push_align(ndr, 8));
1398 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->destination_dsa_guid));
1399 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
1400 if (r->naming_context == NULL) {
1401 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1403 NDR_CHECK(ndr_push_ref_ptr(ndr));
1404 NDR_CHECK(ndr_push_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->highwatermark));
1405 NDR_CHECK(ndr_push_unique_ptr(ndr, r->uptodateness_vector));
1406 NDR_CHECK(ndr_push_drsuapi_DsReplicaNeighbourFlags(ndr, NDR_SCALARS, r->replica_flags));
1407 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_object_count));
1408 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_ndr_size));
1409 NDR_CHECK(ndr_push_drsuapi_DsExtendedOperation(ndr, NDR_SCALARS, r->extended_op));
1410 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->fsmo_info));
1411 NDR_CHECK(ndr_push_unique_ptr(ndr, r->partial_attribute_set));
1412 NDR_CHECK(ndr_push_unique_ptr(ndr, r->partial_attribute_set_ex));
1413 NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_SCALARS, &r->mapping_ctr));
1415 if (ndr_flags & NDR_BUFFERS) {
1416 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
1417 if (r->uptodateness_vector) {
1418 NDR_CHECK(ndr_push_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->uptodateness_vector));
1420 if (r->partial_attribute_set) {
1421 NDR_CHECK(ndr_push_drsuapi_DsPartialAttributeSet(ndr, NDR_SCALARS, r->partial_attribute_set));
1423 if (r->partial_attribute_set_ex) {
1424 NDR_CHECK(ndr_push_drsuapi_DsPartialAttributeSet(ndr, NDR_SCALARS, r->partial_attribute_set_ex));
1426 NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->mapping_ctr));
1428 return NDR_ERR_SUCCESS;
1431 static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesRequest8(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesRequest8 *r)
1433 uint32_t _ptr_naming_context;
1434 TALLOC_CTX *_mem_save_naming_context_0;
1435 uint32_t _ptr_uptodateness_vector;
1436 TALLOC_CTX *_mem_save_uptodateness_vector_0;
1437 uint32_t _ptr_partial_attribute_set;
1438 TALLOC_CTX *_mem_save_partial_attribute_set_0;
1439 uint32_t _ptr_partial_attribute_set_ex;
1440 TALLOC_CTX *_mem_save_partial_attribute_set_ex_0;
1441 if (ndr_flags & NDR_SCALARS) {
1442 NDR_CHECK(ndr_pull_align(ndr, 8));
1443 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->destination_dsa_guid));
1444 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
1445 NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_naming_context));
1446 if (_ptr_naming_context) {
1447 NDR_PULL_ALLOC(ndr, r->naming_context);
1448 } else {
1449 r->naming_context = NULL;
1451 NDR_CHECK(ndr_pull_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->highwatermark));
1452 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_uptodateness_vector));
1453 if (_ptr_uptodateness_vector) {
1454 NDR_PULL_ALLOC(ndr, r->uptodateness_vector);
1455 } else {
1456 r->uptodateness_vector = NULL;
1458 NDR_CHECK(ndr_pull_drsuapi_DsReplicaNeighbourFlags(ndr, NDR_SCALARS, &r->replica_flags));
1459 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_object_count));
1460 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_ndr_size));
1461 NDR_CHECK(ndr_pull_drsuapi_DsExtendedOperation(ndr, NDR_SCALARS, &r->extended_op));
1462 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->fsmo_info));
1463 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_partial_attribute_set));
1464 if (_ptr_partial_attribute_set) {
1465 NDR_PULL_ALLOC(ndr, r->partial_attribute_set);
1466 } else {
1467 r->partial_attribute_set = NULL;
1469 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_partial_attribute_set_ex));
1470 if (_ptr_partial_attribute_set_ex) {
1471 NDR_PULL_ALLOC(ndr, r->partial_attribute_set_ex);
1472 } else {
1473 r->partial_attribute_set_ex = NULL;
1475 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_SCALARS, &r->mapping_ctr));
1477 if (ndr_flags & NDR_BUFFERS) {
1478 _mem_save_naming_context_0 = NDR_PULL_GET_MEM_CTX(ndr);
1479 NDR_PULL_SET_MEM_CTX(ndr, r->naming_context, 0);
1480 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
1481 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_naming_context_0, 0);
1482 if (r->uptodateness_vector) {
1483 _mem_save_uptodateness_vector_0 = NDR_PULL_GET_MEM_CTX(ndr);
1484 NDR_PULL_SET_MEM_CTX(ndr, r->uptodateness_vector, 0);
1485 NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->uptodateness_vector));
1486 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_uptodateness_vector_0, 0);
1488 if (r->partial_attribute_set) {
1489 _mem_save_partial_attribute_set_0 = NDR_PULL_GET_MEM_CTX(ndr);
1490 NDR_PULL_SET_MEM_CTX(ndr, r->partial_attribute_set, 0);
1491 NDR_CHECK(ndr_pull_drsuapi_DsPartialAttributeSet(ndr, NDR_SCALARS, r->partial_attribute_set));
1492 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_partial_attribute_set_0, 0);
1494 if (r->partial_attribute_set_ex) {
1495 _mem_save_partial_attribute_set_ex_0 = NDR_PULL_GET_MEM_CTX(ndr);
1496 NDR_PULL_SET_MEM_CTX(ndr, r->partial_attribute_set_ex, 0);
1497 NDR_CHECK(ndr_pull_drsuapi_DsPartialAttributeSet(ndr, NDR_SCALARS, r->partial_attribute_set_ex));
1498 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_partial_attribute_set_ex_0, 0);
1500 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->mapping_ctr));
1502 return NDR_ERR_SUCCESS;
1505 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesRequest8(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesRequest8 *r)
1507 ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesRequest8");
1508 ndr->depth++;
1509 ndr_print_GUID(ndr, "destination_dsa_guid", &r->destination_dsa_guid);
1510 ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id);
1511 ndr_print_ptr(ndr, "naming_context", r->naming_context);
1512 ndr->depth++;
1513 ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "naming_context", r->naming_context);
1514 ndr->depth--;
1515 ndr_print_drsuapi_DsReplicaHighWaterMark(ndr, "highwatermark", &r->highwatermark);
1516 ndr_print_ptr(ndr, "uptodateness_vector", r->uptodateness_vector);
1517 ndr->depth++;
1518 if (r->uptodateness_vector) {
1519 ndr_print_drsuapi_DsReplicaCursorCtrEx(ndr, "uptodateness_vector", r->uptodateness_vector);
1521 ndr->depth--;
1522 ndr_print_drsuapi_DsReplicaNeighbourFlags(ndr, "replica_flags", r->replica_flags);
1523 ndr_print_uint32(ndr, "max_object_count", r->max_object_count);
1524 ndr_print_uint32(ndr, "max_ndr_size", r->max_ndr_size);
1525 ndr_print_drsuapi_DsExtendedOperation(ndr, "extended_op", r->extended_op);
1526 ndr_print_hyper(ndr, "fsmo_info", r->fsmo_info);
1527 ndr_print_ptr(ndr, "partial_attribute_set", r->partial_attribute_set);
1528 ndr->depth++;
1529 if (r->partial_attribute_set) {
1530 ndr_print_drsuapi_DsPartialAttributeSet(ndr, "partial_attribute_set", r->partial_attribute_set);
1532 ndr->depth--;
1533 ndr_print_ptr(ndr, "partial_attribute_set_ex", r->partial_attribute_set_ex);
1534 ndr->depth++;
1535 if (r->partial_attribute_set_ex) {
1536 ndr_print_drsuapi_DsPartialAttributeSet(ndr, "partial_attribute_set_ex", r->partial_attribute_set_ex);
1538 ndr->depth--;
1539 ndr_print_drsuapi_DsReplicaOIDMapping_Ctr(ndr, "mapping_ctr", &r->mapping_ctr);
1540 ndr->depth--;
1543 static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetNCChangesRequest *r)
1545 if (ndr_flags & NDR_SCALARS) {
1546 int level = ndr_push_get_switch_value(ndr, r);
1547 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
1548 switch (level) {
1549 case 5: {
1550 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesRequest5(ndr, NDR_SCALARS, &r->req5));
1551 break; }
1553 case 8: {
1554 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesRequest8(ndr, NDR_SCALARS, &r->req8));
1555 break; }
1557 default:
1558 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1561 if (ndr_flags & NDR_BUFFERS) {
1562 int level = ndr_push_get_switch_value(ndr, r);
1563 switch (level) {
1564 case 5:
1565 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesRequest5(ndr, NDR_BUFFERS, &r->req5));
1566 break;
1568 case 8:
1569 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesRequest8(ndr, NDR_BUFFERS, &r->req8));
1570 break;
1572 default:
1573 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1576 return NDR_ERR_SUCCESS;
1579 static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetNCChangesRequest *r)
1581 int level;
1582 int32_t _level;
1583 level = ndr_pull_get_switch_value(ndr, r);
1584 if (ndr_flags & NDR_SCALARS) {
1585 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
1586 if (_level != level) {
1587 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
1589 switch (level) {
1590 case 5: {
1591 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesRequest5(ndr, NDR_SCALARS, &r->req5));
1592 break; }
1594 case 8: {
1595 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesRequest8(ndr, NDR_SCALARS, &r->req8));
1596 break; }
1598 default:
1599 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1602 if (ndr_flags & NDR_BUFFERS) {
1603 switch (level) {
1604 case 5:
1605 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesRequest5(ndr, NDR_BUFFERS, &r->req5));
1606 break;
1608 case 8:
1609 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesRequest8(ndr, NDR_BUFFERS, &r->req8));
1610 break;
1612 default:
1613 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1616 return NDR_ERR_SUCCESS;
1619 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetNCChangesRequest *r)
1621 int level;
1622 level = ndr_print_get_switch_value(ndr, r);
1623 ndr_print_union(ndr, name, level, "drsuapi_DsGetNCChangesRequest");
1624 switch (level) {
1625 case 5:
1626 ndr_print_drsuapi_DsGetNCChangesRequest5(ndr, "req5", &r->req5);
1627 break;
1629 case 8:
1630 ndr_print_drsuapi_DsGetNCChangesRequest8(ndr, "req8", &r->req8);
1631 break;
1633 default:
1634 ndr_print_bad_level(ndr, name, level);
1638 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaCursor2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursor2 *r)
1640 if (ndr_flags & NDR_SCALARS) {
1641 NDR_CHECK(ndr_push_align(ndr, 8));
1642 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
1643 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->highest_usn));
1644 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_sync_success));
1646 if (ndr_flags & NDR_BUFFERS) {
1648 return NDR_ERR_SUCCESS;
1651 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursor2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursor2 *r)
1653 if (ndr_flags & NDR_SCALARS) {
1654 NDR_CHECK(ndr_pull_align(ndr, 8));
1655 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
1656 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->highest_usn));
1657 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_sync_success));
1659 if (ndr_flags & NDR_BUFFERS) {
1661 return NDR_ERR_SUCCESS;
1664 _PUBLIC_ void ndr_print_drsuapi_DsReplicaCursor2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursor2 *r)
1666 ndr_print_struct(ndr, name, "drsuapi_DsReplicaCursor2");
1667 ndr->depth++;
1668 ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id);
1669 ndr_print_hyper(ndr, "highest_usn", r->highest_usn);
1670 ndr_print_NTTIME(ndr, "last_sync_success", r->last_sync_success);
1671 ndr->depth--;
1674 static enum ndr_err_code ndr_push_drsuapi_DsReplicaCursor2CtrEx(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursor2CtrEx *r)
1676 uint32_t cntr_cursors_0;
1677 if (ndr_flags & NDR_SCALARS) {
1678 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
1679 NDR_CHECK(ndr_push_align(ndr, 8));
1680 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 2));
1681 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
1682 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
1683 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
1684 for (cntr_cursors_0 = 0; cntr_cursors_0 < r->count; cntr_cursors_0++) {
1685 NDR_CHECK(ndr_push_drsuapi_DsReplicaCursor2(ndr, NDR_SCALARS, &r->cursors[cntr_cursors_0]));
1688 if (ndr_flags & NDR_BUFFERS) {
1690 return NDR_ERR_SUCCESS;
1693 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursor2CtrEx(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursor2CtrEx *r)
1695 uint32_t cntr_cursors_0;
1696 TALLOC_CTX *_mem_save_cursors_0;
1697 if (ndr_flags & NDR_SCALARS) {
1698 NDR_CHECK(ndr_pull_array_size(ndr, &r->cursors));
1699 NDR_CHECK(ndr_pull_align(ndr, 8));
1700 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
1701 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved1));
1702 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
1703 if (r->count > 0x100000) {
1704 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
1706 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved2));
1707 NDR_PULL_ALLOC_N(ndr, r->cursors, ndr_get_array_size(ndr, &r->cursors));
1708 _mem_save_cursors_0 = NDR_PULL_GET_MEM_CTX(ndr);
1709 NDR_PULL_SET_MEM_CTX(ndr, r->cursors, 0);
1710 for (cntr_cursors_0 = 0; cntr_cursors_0 < r->count; cntr_cursors_0++) {
1711 NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursor2(ndr, NDR_SCALARS, &r->cursors[cntr_cursors_0]));
1713 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_cursors_0, 0);
1714 if (r->cursors) {
1715 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->cursors, r->count));
1718 if (ndr_flags & NDR_BUFFERS) {
1720 return NDR_ERR_SUCCESS;
1723 _PUBLIC_ void ndr_print_drsuapi_DsReplicaCursor2CtrEx(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursor2CtrEx *r)
1725 uint32_t cntr_cursors_0;
1726 ndr_print_struct(ndr, name, "drsuapi_DsReplicaCursor2CtrEx");
1727 ndr->depth++;
1728 ndr_print_uint32(ndr, "version", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?2:r->version);
1729 ndr_print_uint32(ndr, "reserved1", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved1);
1730 ndr_print_uint32(ndr, "count", r->count);
1731 ndr_print_uint32(ndr, "reserved2", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved2);
1732 ndr->print(ndr, "%s: ARRAY(%d)", "cursors", (int)r->count);
1733 ndr->depth++;
1734 for (cntr_cursors_0=0;cntr_cursors_0<r->count;cntr_cursors_0++) {
1735 char *idx_0=NULL;
1736 if (asprintf(&idx_0, "[%d]", cntr_cursors_0) != -1) {
1737 ndr_print_drsuapi_DsReplicaCursor2(ndr, "cursors", &r->cursors[cntr_cursors_0]);
1738 free(idx_0);
1741 ndr->depth--;
1742 ndr->depth--;
1745 static enum ndr_err_code ndr_push_drsuapi_DsAttributeValue(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAttributeValue *r)
1747 if (ndr_flags & NDR_SCALARS) {
1748 NDR_CHECK(ndr_push_align(ndr, 4));
1749 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_DATA_BLOB(0, r->blob, 0)));
1750 NDR_CHECK(ndr_push_unique_ptr(ndr, r->blob));
1752 if (ndr_flags & NDR_BUFFERS) {
1753 if (r->blob) {
1754 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, *r->blob));
1757 return NDR_ERR_SUCCESS;
1760 static enum ndr_err_code ndr_pull_drsuapi_DsAttributeValue(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAttributeValue *r)
1762 uint32_t _ptr_blob;
1763 TALLOC_CTX *_mem_save_blob_0;
1764 if (ndr_flags & NDR_SCALARS) {
1765 NDR_CHECK(ndr_pull_align(ndr, 4));
1766 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size));
1767 if (r->__ndr_size > 10485760) {
1768 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
1770 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_blob));
1771 if (_ptr_blob) {
1772 NDR_PULL_ALLOC(ndr, r->blob);
1773 } else {
1774 r->blob = NULL;
1777 if (ndr_flags & NDR_BUFFERS) {
1778 if (r->blob) {
1779 _mem_save_blob_0 = NDR_PULL_GET_MEM_CTX(ndr);
1780 NDR_PULL_SET_MEM_CTX(ndr, r->blob, 0);
1781 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, r->blob));
1782 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_blob_0, 0);
1785 return NDR_ERR_SUCCESS;
1788 _PUBLIC_ void ndr_print_drsuapi_DsAttributeValue(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAttributeValue *r)
1790 ndr_print_struct(ndr, name, "drsuapi_DsAttributeValue");
1791 ndr->depth++;
1792 ndr_print_uint32(ndr, "__ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_DATA_BLOB(0, r->blob, 0):r->__ndr_size);
1793 ndr_print_ptr(ndr, "blob", r->blob);
1794 ndr->depth++;
1795 if (r->blob) {
1796 ndr_print_DATA_BLOB(ndr, "blob", *r->blob);
1798 ndr->depth--;
1799 ndr->depth--;
1802 static enum ndr_err_code ndr_push_drsuapi_DsAttributeValueCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAttributeValueCtr *r)
1804 uint32_t cntr_values_1;
1805 if (ndr_flags & NDR_SCALARS) {
1806 NDR_CHECK(ndr_push_align(ndr, 4));
1807 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_values));
1808 NDR_CHECK(ndr_push_unique_ptr(ndr, r->values));
1810 if (ndr_flags & NDR_BUFFERS) {
1811 if (r->values) {
1812 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_values));
1813 for (cntr_values_1 = 0; cntr_values_1 < r->num_values; cntr_values_1++) {
1814 NDR_CHECK(ndr_push_drsuapi_DsAttributeValue(ndr, NDR_SCALARS, &r->values[cntr_values_1]));
1816 for (cntr_values_1 = 0; cntr_values_1 < r->num_values; cntr_values_1++) {
1817 NDR_CHECK(ndr_push_drsuapi_DsAttributeValue(ndr, NDR_BUFFERS, &r->values[cntr_values_1]));
1821 return NDR_ERR_SUCCESS;
1824 static enum ndr_err_code ndr_pull_drsuapi_DsAttributeValueCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAttributeValueCtr *r)
1826 uint32_t _ptr_values;
1827 uint32_t cntr_values_1;
1828 TALLOC_CTX *_mem_save_values_0;
1829 TALLOC_CTX *_mem_save_values_1;
1830 if (ndr_flags & NDR_SCALARS) {
1831 NDR_CHECK(ndr_pull_align(ndr, 4));
1832 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_values));
1833 if (r->num_values > 10485760) {
1834 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
1836 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_values));
1837 if (_ptr_values) {
1838 NDR_PULL_ALLOC(ndr, r->values);
1839 } else {
1840 r->values = NULL;
1843 if (ndr_flags & NDR_BUFFERS) {
1844 if (r->values) {
1845 _mem_save_values_0 = NDR_PULL_GET_MEM_CTX(ndr);
1846 NDR_PULL_SET_MEM_CTX(ndr, r->values, 0);
1847 NDR_CHECK(ndr_pull_array_size(ndr, &r->values));
1848 NDR_PULL_ALLOC_N(ndr, r->values, ndr_get_array_size(ndr, &r->values));
1849 _mem_save_values_1 = NDR_PULL_GET_MEM_CTX(ndr);
1850 NDR_PULL_SET_MEM_CTX(ndr, r->values, 0);
1851 for (cntr_values_1 = 0; cntr_values_1 < r->num_values; cntr_values_1++) {
1852 NDR_CHECK(ndr_pull_drsuapi_DsAttributeValue(ndr, NDR_SCALARS, &r->values[cntr_values_1]));
1854 for (cntr_values_1 = 0; cntr_values_1 < r->num_values; cntr_values_1++) {
1855 NDR_CHECK(ndr_pull_drsuapi_DsAttributeValue(ndr, NDR_BUFFERS, &r->values[cntr_values_1]));
1857 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_values_1, 0);
1858 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_values_0, 0);
1860 if (r->values) {
1861 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->values, r->num_values));
1864 return NDR_ERR_SUCCESS;
1867 _PUBLIC_ void ndr_print_drsuapi_DsAttributeValueCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAttributeValueCtr *r)
1869 uint32_t cntr_values_1;
1870 ndr_print_struct(ndr, name, "drsuapi_DsAttributeValueCtr");
1871 ndr->depth++;
1872 ndr_print_uint32(ndr, "num_values", r->num_values);
1873 ndr_print_ptr(ndr, "values", r->values);
1874 ndr->depth++;
1875 if (r->values) {
1876 ndr->print(ndr, "%s: ARRAY(%d)", "values", (int)r->num_values);
1877 ndr->depth++;
1878 for (cntr_values_1=0;cntr_values_1<r->num_values;cntr_values_1++) {
1879 char *idx_1=NULL;
1880 if (asprintf(&idx_1, "[%d]", cntr_values_1) != -1) {
1881 ndr_print_drsuapi_DsAttributeValue(ndr, "values", &r->values[cntr_values_1]);
1882 free(idx_1);
1885 ndr->depth--;
1887 ndr->depth--;
1888 ndr->depth--;
1891 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectIdentifier3(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectIdentifier3 *r)
1893 if (ndr_flags & NDR_SCALARS) {
1894 NDR_CHECK(ndr_push_align(ndr, 4));
1895 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_drsuapi_DsReplicaObjectIdentifier3(r, ndr->iconv_convenience, ndr->flags)));
1896 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_dom_sid28(&r->sid, ndr->flags)));
1897 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->guid));
1898 NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_SCALARS, &r->sid));
1899 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m(r->dn)));
1900 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dn, strlen_m(r->dn) + 1, sizeof(uint16_t), CH_UTF16));
1902 if (ndr_flags & NDR_BUFFERS) {
1903 NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_BUFFERS, &r->sid));
1905 return NDR_ERR_SUCCESS;
1908 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectIdentifier3(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectIdentifier3 *r)
1910 if (ndr_flags & NDR_SCALARS) {
1911 NDR_CHECK(ndr_pull_align(ndr, 4));
1912 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size));
1913 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_sid));
1914 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->guid));
1915 NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_SCALARS, &r->sid));
1916 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_dn));
1917 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dn, r->__ndr_size_dn + 1, sizeof(uint16_t), CH_UTF16));
1919 if (ndr_flags & NDR_BUFFERS) {
1920 NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_BUFFERS, &r->sid));
1922 return NDR_ERR_SUCCESS;
1925 _PUBLIC_ void ndr_print_drsuapi_DsReplicaObjectIdentifier3(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjectIdentifier3 *r)
1927 ndr_print_struct(ndr, name, "drsuapi_DsReplicaObjectIdentifier3");
1928 ndr->depth++;
1929 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);
1930 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);
1931 ndr_print_GUID(ndr, "guid", &r->guid);
1932 ndr_print_dom_sid28(ndr, "sid", &r->sid);
1933 ndr_print_uint32(ndr, "__ndr_size_dn", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m(r->dn):r->__ndr_size_dn);
1934 ndr_print_string(ndr, "dn", r->dn);
1935 ndr->depth--;
1938 _PUBLIC_ size_t ndr_size_drsuapi_DsReplicaObjectIdentifier3(const struct drsuapi_DsReplicaObjectIdentifier3 *r, struct smb_iconv_convenience *ic, int flags)
1940 return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3, ic);
1943 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectIdentifier3Binary(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectIdentifier3Binary *r)
1945 if (ndr_flags & NDR_SCALARS) {
1946 NDR_CHECK(ndr_push_align(ndr, 4));
1947 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary(r, ndr->iconv_convenience, ndr->flags)));
1948 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_dom_sid28(&r->sid, ndr->flags)));
1949 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->guid));
1950 NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_SCALARS, &r->sid));
1951 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m(r->dn)));
1952 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dn, strlen_m(r->dn) + 1, sizeof(uint16_t), CH_UTF16));
1953 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->binary.length + 4));
1955 uint32_t _flags_save_DATA_BLOB = ndr->flags;
1956 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
1957 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->binary));
1958 ndr->flags = _flags_save_DATA_BLOB;
1961 if (ndr_flags & NDR_BUFFERS) {
1962 NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_BUFFERS, &r->sid));
1964 return NDR_ERR_SUCCESS;
1967 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectIdentifier3Binary(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectIdentifier3Binary *r)
1969 if (ndr_flags & NDR_SCALARS) {
1970 NDR_CHECK(ndr_pull_align(ndr, 4));
1971 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size));
1972 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_sid));
1973 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->guid));
1974 NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_SCALARS, &r->sid));
1975 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_dn));
1976 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dn, r->__ndr_size_dn + 1, sizeof(uint16_t), CH_UTF16));
1977 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_binary));
1979 uint32_t _flags_save_DATA_BLOB = ndr->flags;
1980 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
1981 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->binary));
1982 ndr->flags = _flags_save_DATA_BLOB;
1985 if (ndr_flags & NDR_BUFFERS) {
1986 NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_BUFFERS, &r->sid));
1988 return NDR_ERR_SUCCESS;
1991 _PUBLIC_ void ndr_print_drsuapi_DsReplicaObjectIdentifier3Binary(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjectIdentifier3Binary *r)
1993 ndr_print_struct(ndr, name, "drsuapi_DsReplicaObjectIdentifier3Binary");
1994 ndr->depth++;
1995 ndr_print_uint32(ndr, "__ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary(r, ndr->iconv_convenience, ndr->flags):r->__ndr_size);
1996 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);
1997 ndr_print_GUID(ndr, "guid", &r->guid);
1998 ndr_print_dom_sid28(ndr, "sid", &r->sid);
1999 ndr_print_uint32(ndr, "__ndr_size_dn", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m(r->dn):r->__ndr_size_dn);
2000 ndr_print_string(ndr, "dn", r->dn);
2001 ndr_print_uint32(ndr, "__ndr_size_binary", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->binary.length + 4:r->__ndr_size_binary);
2002 ndr_print_DATA_BLOB(ndr, "binary", r->binary);
2003 ndr->depth--;
2006 _PUBLIC_ size_t ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary(const struct drsuapi_DsReplicaObjectIdentifier3Binary *r, struct smb_iconv_convenience *ic, int flags)
2008 return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3Binary, ic);
2011 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaAttribute(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaAttribute *r)
2013 if (ndr_flags & NDR_SCALARS) {
2014 NDR_CHECK(ndr_push_align(ndr, 4));
2015 NDR_CHECK(ndr_push_drsuapi_DsAttributeId(ndr, NDR_SCALARS, r->attid));
2016 NDR_CHECK(ndr_push_drsuapi_DsAttributeValueCtr(ndr, NDR_SCALARS, &r->value_ctr));
2018 if (ndr_flags & NDR_BUFFERS) {
2019 NDR_CHECK(ndr_push_drsuapi_DsAttributeValueCtr(ndr, NDR_BUFFERS, &r->value_ctr));
2021 return NDR_ERR_SUCCESS;
2024 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaAttribute(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaAttribute *r)
2026 if (ndr_flags & NDR_SCALARS) {
2027 NDR_CHECK(ndr_pull_align(ndr, 4));
2028 NDR_CHECK(ndr_pull_drsuapi_DsAttributeId(ndr, NDR_SCALARS, &r->attid));
2029 NDR_CHECK(ndr_pull_drsuapi_DsAttributeValueCtr(ndr, NDR_SCALARS, &r->value_ctr));
2031 if (ndr_flags & NDR_BUFFERS) {
2032 NDR_CHECK(ndr_pull_drsuapi_DsAttributeValueCtr(ndr, NDR_BUFFERS, &r->value_ctr));
2034 return NDR_ERR_SUCCESS;
2037 _PUBLIC_ void ndr_print_drsuapi_DsReplicaAttribute(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaAttribute *r)
2039 ndr_print_struct(ndr, name, "drsuapi_DsReplicaAttribute");
2040 ndr->depth++;
2041 ndr_print_drsuapi_DsAttributeId(ndr, "attid", r->attid);
2042 ndr_print_drsuapi_DsAttributeValueCtr(ndr, "value_ctr", &r->value_ctr);
2043 ndr->depth--;
2046 static enum ndr_err_code ndr_push_drsuapi_DsReplicaAttributeCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaAttributeCtr *r)
2048 uint32_t cntr_attributes_1;
2049 if (ndr_flags & NDR_SCALARS) {
2050 NDR_CHECK(ndr_push_align(ndr, 4));
2051 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_attributes));
2052 NDR_CHECK(ndr_push_unique_ptr(ndr, r->attributes));
2054 if (ndr_flags & NDR_BUFFERS) {
2055 if (r->attributes) {
2056 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_attributes));
2057 for (cntr_attributes_1 = 0; cntr_attributes_1 < r->num_attributes; cntr_attributes_1++) {
2058 NDR_CHECK(ndr_push_drsuapi_DsReplicaAttribute(ndr, NDR_SCALARS, &r->attributes[cntr_attributes_1]));
2060 for (cntr_attributes_1 = 0; cntr_attributes_1 < r->num_attributes; cntr_attributes_1++) {
2061 NDR_CHECK(ndr_push_drsuapi_DsReplicaAttribute(ndr, NDR_BUFFERS, &r->attributes[cntr_attributes_1]));
2065 return NDR_ERR_SUCCESS;
2068 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaAttributeCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaAttributeCtr *r)
2070 uint32_t _ptr_attributes;
2071 uint32_t cntr_attributes_1;
2072 TALLOC_CTX *_mem_save_attributes_0;
2073 TALLOC_CTX *_mem_save_attributes_1;
2074 if (ndr_flags & NDR_SCALARS) {
2075 NDR_CHECK(ndr_pull_align(ndr, 4));
2076 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_attributes));
2077 if (r->num_attributes > 1048576) {
2078 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
2080 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_attributes));
2081 if (_ptr_attributes) {
2082 NDR_PULL_ALLOC(ndr, r->attributes);
2083 } else {
2084 r->attributes = NULL;
2087 if (ndr_flags & NDR_BUFFERS) {
2088 if (r->attributes) {
2089 _mem_save_attributes_0 = NDR_PULL_GET_MEM_CTX(ndr);
2090 NDR_PULL_SET_MEM_CTX(ndr, r->attributes, 0);
2091 NDR_CHECK(ndr_pull_array_size(ndr, &r->attributes));
2092 NDR_PULL_ALLOC_N(ndr, r->attributes, ndr_get_array_size(ndr, &r->attributes));
2093 _mem_save_attributes_1 = NDR_PULL_GET_MEM_CTX(ndr);
2094 NDR_PULL_SET_MEM_CTX(ndr, r->attributes, 0);
2095 for (cntr_attributes_1 = 0; cntr_attributes_1 < r->num_attributes; cntr_attributes_1++) {
2096 NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttribute(ndr, NDR_SCALARS, &r->attributes[cntr_attributes_1]));
2098 for (cntr_attributes_1 = 0; cntr_attributes_1 < r->num_attributes; cntr_attributes_1++) {
2099 NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttribute(ndr, NDR_BUFFERS, &r->attributes[cntr_attributes_1]));
2101 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attributes_1, 0);
2102 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attributes_0, 0);
2104 if (r->attributes) {
2105 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->attributes, r->num_attributes));
2108 return NDR_ERR_SUCCESS;
2111 _PUBLIC_ void ndr_print_drsuapi_DsReplicaAttributeCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaAttributeCtr *r)
2113 uint32_t cntr_attributes_1;
2114 ndr_print_struct(ndr, name, "drsuapi_DsReplicaAttributeCtr");
2115 ndr->depth++;
2116 ndr_print_uint32(ndr, "num_attributes", r->num_attributes);
2117 ndr_print_ptr(ndr, "attributes", r->attributes);
2118 ndr->depth++;
2119 if (r->attributes) {
2120 ndr->print(ndr, "%s: ARRAY(%d)", "attributes", (int)r->num_attributes);
2121 ndr->depth++;
2122 for (cntr_attributes_1=0;cntr_attributes_1<r->num_attributes;cntr_attributes_1++) {
2123 char *idx_1=NULL;
2124 if (asprintf(&idx_1, "[%d]", cntr_attributes_1) != -1) {
2125 ndr_print_drsuapi_DsReplicaAttribute(ndr, "attributes", &r->attributes[cntr_attributes_1]);
2126 free(idx_1);
2129 ndr->depth--;
2131 ndr->depth--;
2132 ndr->depth--;
2135 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
2137 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
2138 return NDR_ERR_SUCCESS;
2141 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
2143 uint32_t v;
2144 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
2145 *r = v;
2146 return NDR_ERR_SUCCESS;
2149 _PUBLIC_ void ndr_print_drsuapi_DsReplicaObjectFlags(struct ndr_print *ndr, const char *name, uint32_t r)
2151 ndr_print_uint32(ndr, name, r);
2152 ndr->depth++;
2153 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_OBJECT_FROM_MASTER", DRSUAPI_DS_REPLICA_OBJECT_FROM_MASTER, r);
2154 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_OBJECT_DYNAMIC", DRSUAPI_DS_REPLICA_OBJECT_DYNAMIC, r);
2155 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_OBJECT_REMOTE_MODIFY", DRSUAPI_DS_REPLICA_OBJECT_REMOTE_MODIFY, r);
2156 ndr->depth--;
2159 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObject(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObject *r)
2161 if (ndr_flags & NDR_SCALARS) {
2162 NDR_CHECK(ndr_push_align(ndr, 4));
2163 NDR_CHECK(ndr_push_unique_ptr(ndr, r->identifier));
2164 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectFlags(ndr, NDR_SCALARS, r->flags));
2165 NDR_CHECK(ndr_push_drsuapi_DsReplicaAttributeCtr(ndr, NDR_SCALARS, &r->attribute_ctr));
2167 if (ndr_flags & NDR_BUFFERS) {
2168 if (r->identifier) {
2169 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->identifier));
2171 NDR_CHECK(ndr_push_drsuapi_DsReplicaAttributeCtr(ndr, NDR_BUFFERS, &r->attribute_ctr));
2173 return NDR_ERR_SUCCESS;
2176 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaObject(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObject *r)
2178 uint32_t _ptr_identifier;
2179 TALLOC_CTX *_mem_save_identifier_0;
2180 if (ndr_flags & NDR_SCALARS) {
2181 NDR_CHECK(ndr_pull_align(ndr, 4));
2182 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_identifier));
2183 if (_ptr_identifier) {
2184 NDR_PULL_ALLOC(ndr, r->identifier);
2185 } else {
2186 r->identifier = NULL;
2188 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectFlags(ndr, NDR_SCALARS, &r->flags));
2189 NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttributeCtr(ndr, NDR_SCALARS, &r->attribute_ctr));
2191 if (ndr_flags & NDR_BUFFERS) {
2192 if (r->identifier) {
2193 _mem_save_identifier_0 = NDR_PULL_GET_MEM_CTX(ndr);
2194 NDR_PULL_SET_MEM_CTX(ndr, r->identifier, 0);
2195 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->identifier));
2196 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_identifier_0, 0);
2198 NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttributeCtr(ndr, NDR_BUFFERS, &r->attribute_ctr));
2200 return NDR_ERR_SUCCESS;
2203 _PUBLIC_ void ndr_print_drsuapi_DsReplicaObject(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObject *r)
2205 ndr_print_struct(ndr, name, "drsuapi_DsReplicaObject");
2206 ndr->depth++;
2207 ndr_print_ptr(ndr, "identifier", r->identifier);
2208 ndr->depth++;
2209 if (r->identifier) {
2210 ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "identifier", r->identifier);
2212 ndr->depth--;
2213 ndr_print_drsuapi_DsReplicaObjectFlags(ndr, "flags", r->flags);
2214 ndr_print_drsuapi_DsReplicaAttributeCtr(ndr, "attribute_ctr", &r->attribute_ctr);
2215 ndr->depth--;
2218 static enum ndr_err_code ndr_push_drsuapi_DsReplicaMetaData(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaMetaData *r)
2220 if (ndr_flags & NDR_SCALARS) {
2221 NDR_CHECK(ndr_push_align(ndr, 8));
2222 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version));
2223 NDR_CHECK(ndr_push_NTTIME_1sec(ndr, NDR_SCALARS, r->originating_change_time));
2224 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id));
2225 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->originating_usn));
2227 if (ndr_flags & NDR_BUFFERS) {
2229 return NDR_ERR_SUCCESS;
2232 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaMetaData(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaMetaData *r)
2234 if (ndr_flags & NDR_SCALARS) {
2235 NDR_CHECK(ndr_pull_align(ndr, 8));
2236 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
2237 NDR_CHECK(ndr_pull_NTTIME_1sec(ndr, NDR_SCALARS, &r->originating_change_time));
2238 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id));
2239 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->originating_usn));
2241 if (ndr_flags & NDR_BUFFERS) {
2243 return NDR_ERR_SUCCESS;
2246 _PUBLIC_ void ndr_print_drsuapi_DsReplicaMetaData(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaMetaData *r)
2248 ndr_print_struct(ndr, name, "drsuapi_DsReplicaMetaData");
2249 ndr->depth++;
2250 ndr_print_uint32(ndr, "version", r->version);
2251 ndr_print_NTTIME_1sec(ndr, "originating_change_time", r->originating_change_time);
2252 ndr_print_GUID(ndr, "originating_invocation_id", &r->originating_invocation_id);
2253 ndr_print_hyper(ndr, "originating_usn", r->originating_usn);
2254 ndr->depth--;
2257 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaMetaDataCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaMetaDataCtr *r)
2259 uint32_t cntr_meta_data_0;
2260 if (ndr_flags & NDR_SCALARS) {
2261 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
2262 NDR_CHECK(ndr_push_align(ndr, 8));
2263 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
2264 for (cntr_meta_data_0 = 0; cntr_meta_data_0 < r->count; cntr_meta_data_0++) {
2265 NDR_CHECK(ndr_push_drsuapi_DsReplicaMetaData(ndr, NDR_SCALARS, &r->meta_data[cntr_meta_data_0]));
2268 if (ndr_flags & NDR_BUFFERS) {
2270 return NDR_ERR_SUCCESS;
2273 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaMetaDataCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaMetaDataCtr *r)
2275 uint32_t cntr_meta_data_0;
2276 TALLOC_CTX *_mem_save_meta_data_0;
2277 if (ndr_flags & NDR_SCALARS) {
2278 NDR_CHECK(ndr_pull_array_size(ndr, &r->meta_data));
2279 NDR_CHECK(ndr_pull_align(ndr, 8));
2280 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
2281 if (r->count > 1048576) {
2282 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
2284 NDR_PULL_ALLOC_N(ndr, r->meta_data, ndr_get_array_size(ndr, &r->meta_data));
2285 _mem_save_meta_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
2286 NDR_PULL_SET_MEM_CTX(ndr, r->meta_data, 0);
2287 for (cntr_meta_data_0 = 0; cntr_meta_data_0 < r->count; cntr_meta_data_0++) {
2288 NDR_CHECK(ndr_pull_drsuapi_DsReplicaMetaData(ndr, NDR_SCALARS, &r->meta_data[cntr_meta_data_0]));
2290 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_meta_data_0, 0);
2291 if (r->meta_data) {
2292 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->meta_data, r->count));
2295 if (ndr_flags & NDR_BUFFERS) {
2297 return NDR_ERR_SUCCESS;
2300 _PUBLIC_ void ndr_print_drsuapi_DsReplicaMetaDataCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaMetaDataCtr *r)
2302 uint32_t cntr_meta_data_0;
2303 ndr_print_struct(ndr, name, "drsuapi_DsReplicaMetaDataCtr");
2304 ndr->depth++;
2305 ndr_print_uint32(ndr, "count", r->count);
2306 ndr->print(ndr, "%s: ARRAY(%d)", "meta_data", (int)r->count);
2307 ndr->depth++;
2308 for (cntr_meta_data_0=0;cntr_meta_data_0<r->count;cntr_meta_data_0++) {
2309 char *idx_0=NULL;
2310 if (asprintf(&idx_0, "[%d]", cntr_meta_data_0) != -1) {
2311 ndr_print_drsuapi_DsReplicaMetaData(ndr, "meta_data", &r->meta_data[cntr_meta_data_0]);
2312 free(idx_0);
2315 ndr->depth--;
2316 ndr->depth--;
2319 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectListItemEx(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectListItemEx *r)
2321 if (ndr_flags & NDR_SCALARS) {
2322 NDR_CHECK(ndr_push_align(ndr, 4));
2323 NDR_CHECK(ndr_push_unique_ptr(ndr, r->next_object));
2324 NDR_CHECK(ndr_push_drsuapi_DsReplicaObject(ndr, NDR_SCALARS, &r->object));
2325 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_nc_prefix));
2326 NDR_CHECK(ndr_push_unique_ptr(ndr, r->parent_object_guid));
2327 NDR_CHECK(ndr_push_unique_ptr(ndr, r->meta_data_ctr));
2329 if (ndr_flags & NDR_BUFFERS) {
2330 if (r->next_object) {
2331 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectListItemEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->next_object));
2333 NDR_CHECK(ndr_push_drsuapi_DsReplicaObject(ndr, NDR_BUFFERS, &r->object));
2334 if (r->parent_object_guid) {
2335 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->parent_object_guid));
2337 if (r->meta_data_ctr) {
2338 NDR_CHECK(ndr_push_drsuapi_DsReplicaMetaDataCtr(ndr, NDR_SCALARS, r->meta_data_ctr));
2341 return NDR_ERR_SUCCESS;
2344 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectListItemEx(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectListItemEx *r)
2346 uint32_t _ptr_next_object;
2347 TALLOC_CTX *_mem_save_next_object_0;
2348 uint32_t _ptr_parent_object_guid;
2349 TALLOC_CTX *_mem_save_parent_object_guid_0;
2350 uint32_t _ptr_meta_data_ctr;
2351 TALLOC_CTX *_mem_save_meta_data_ctr_0;
2352 if (ndr_flags & NDR_SCALARS) {
2353 NDR_CHECK(ndr_pull_align(ndr, 4));
2354 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_next_object));
2355 if (_ptr_next_object) {
2356 NDR_PULL_ALLOC(ndr, r->next_object);
2357 } else {
2358 r->next_object = NULL;
2360 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObject(ndr, NDR_SCALARS, &r->object));
2361 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_nc_prefix));
2362 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_parent_object_guid));
2363 if (_ptr_parent_object_guid) {
2364 NDR_PULL_ALLOC(ndr, r->parent_object_guid);
2365 } else {
2366 r->parent_object_guid = NULL;
2368 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_meta_data_ctr));
2369 if (_ptr_meta_data_ctr) {
2370 NDR_PULL_ALLOC(ndr, r->meta_data_ctr);
2371 } else {
2372 r->meta_data_ctr = NULL;
2375 if (ndr_flags & NDR_BUFFERS) {
2376 if (r->next_object) {
2377 _mem_save_next_object_0 = NDR_PULL_GET_MEM_CTX(ndr);
2378 NDR_PULL_SET_MEM_CTX(ndr, r->next_object, 0);
2379 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectListItemEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->next_object));
2380 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_next_object_0, 0);
2382 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObject(ndr, NDR_BUFFERS, &r->object));
2383 if (r->parent_object_guid) {
2384 _mem_save_parent_object_guid_0 = NDR_PULL_GET_MEM_CTX(ndr);
2385 NDR_PULL_SET_MEM_CTX(ndr, r->parent_object_guid, 0);
2386 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, r->parent_object_guid));
2387 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parent_object_guid_0, 0);
2389 if (r->meta_data_ctr) {
2390 _mem_save_meta_data_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr);
2391 NDR_PULL_SET_MEM_CTX(ndr, r->meta_data_ctr, 0);
2392 NDR_CHECK(ndr_pull_drsuapi_DsReplicaMetaDataCtr(ndr, NDR_SCALARS, r->meta_data_ctr));
2393 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_meta_data_ctr_0, 0);
2396 return NDR_ERR_SUCCESS;
2399 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesCtr1 *r)
2401 if (ndr_flags & NDR_SCALARS) {
2402 NDR_CHECK(ndr_push_align(ndr, 8));
2403 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_guid));
2404 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
2405 NDR_CHECK(ndr_push_unique_ptr(ndr, r->naming_context));
2406 NDR_CHECK(ndr_push_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->old_highwatermark));
2407 NDR_CHECK(ndr_push_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->new_highwatermark));
2408 NDR_CHECK(ndr_push_unique_ptr(ndr, r->uptodateness_vector));
2409 NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_SCALARS, &r->mapping_ctr));
2410 NDR_CHECK(ndr_push_drsuapi_DsExtendedError(ndr, NDR_SCALARS, r->extended_ret));
2411 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->object_count));
2412 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_drsuapi_DsGetNCChangesCtr1(r, ndr->iconv_convenience, ndr->flags) + 55));
2413 NDR_CHECK(ndr_push_unique_ptr(ndr, r->first_object));
2414 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->more_data));
2416 if (ndr_flags & NDR_BUFFERS) {
2417 if (r->naming_context) {
2418 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
2420 if (r->uptodateness_vector) {
2421 NDR_CHECK(ndr_push_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->uptodateness_vector));
2423 NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->mapping_ctr));
2424 if (r->first_object) {
2425 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectListItemEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->first_object));
2428 return NDR_ERR_SUCCESS;
2431 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesCtr1 *r)
2433 uint32_t _ptr_naming_context;
2434 TALLOC_CTX *_mem_save_naming_context_0;
2435 uint32_t _ptr_uptodateness_vector;
2436 TALLOC_CTX *_mem_save_uptodateness_vector_0;
2437 uint32_t _ptr_first_object;
2438 TALLOC_CTX *_mem_save_first_object_0;
2439 if (ndr_flags & NDR_SCALARS) {
2440 NDR_CHECK(ndr_pull_align(ndr, 8));
2441 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_guid));
2442 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
2443 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_naming_context));
2444 if (_ptr_naming_context) {
2445 NDR_PULL_ALLOC(ndr, r->naming_context);
2446 } else {
2447 r->naming_context = NULL;
2449 NDR_CHECK(ndr_pull_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->old_highwatermark));
2450 NDR_CHECK(ndr_pull_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->new_highwatermark));
2451 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_uptodateness_vector));
2452 if (_ptr_uptodateness_vector) {
2453 NDR_PULL_ALLOC(ndr, r->uptodateness_vector);
2454 } else {
2455 r->uptodateness_vector = NULL;
2457 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_SCALARS, &r->mapping_ctr));
2458 NDR_CHECK(ndr_pull_drsuapi_DsExtendedError(ndr, NDR_SCALARS, &r->extended_ret));
2459 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->object_count));
2460 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size));
2461 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_first_object));
2462 if (_ptr_first_object) {
2463 NDR_PULL_ALLOC(ndr, r->first_object);
2464 } else {
2465 r->first_object = NULL;
2467 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->more_data));
2469 if (ndr_flags & NDR_BUFFERS) {
2470 if (r->naming_context) {
2471 _mem_save_naming_context_0 = NDR_PULL_GET_MEM_CTX(ndr);
2472 NDR_PULL_SET_MEM_CTX(ndr, r->naming_context, 0);
2473 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
2474 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_naming_context_0, 0);
2476 if (r->uptodateness_vector) {
2477 _mem_save_uptodateness_vector_0 = NDR_PULL_GET_MEM_CTX(ndr);
2478 NDR_PULL_SET_MEM_CTX(ndr, r->uptodateness_vector, 0);
2479 NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->uptodateness_vector));
2480 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_uptodateness_vector_0, 0);
2482 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->mapping_ctr));
2483 if (r->first_object) {
2484 _mem_save_first_object_0 = NDR_PULL_GET_MEM_CTX(ndr);
2485 NDR_PULL_SET_MEM_CTX(ndr, r->first_object, 0);
2486 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectListItemEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->first_object));
2487 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_first_object_0, 0);
2490 return NDR_ERR_SUCCESS;
2493 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr1 *r)
2495 ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesCtr1");
2496 ndr->depth++;
2497 ndr_print_GUID(ndr, "source_dsa_guid", &r->source_dsa_guid);
2498 ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id);
2499 ndr_print_ptr(ndr, "naming_context", r->naming_context);
2500 ndr->depth++;
2501 if (r->naming_context) {
2502 ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "naming_context", r->naming_context);
2504 ndr->depth--;
2505 ndr_print_drsuapi_DsReplicaHighWaterMark(ndr, "old_highwatermark", &r->old_highwatermark);
2506 ndr_print_drsuapi_DsReplicaHighWaterMark(ndr, "new_highwatermark", &r->new_highwatermark);
2507 ndr_print_ptr(ndr, "uptodateness_vector", r->uptodateness_vector);
2508 ndr->depth++;
2509 if (r->uptodateness_vector) {
2510 ndr_print_drsuapi_DsReplicaCursorCtrEx(ndr, "uptodateness_vector", r->uptodateness_vector);
2512 ndr->depth--;
2513 ndr_print_drsuapi_DsReplicaOIDMapping_Ctr(ndr, "mapping_ctr", &r->mapping_ctr);
2514 ndr_print_drsuapi_DsExtendedError(ndr, "extended_ret", r->extended_ret);
2515 ndr_print_uint32(ndr, "object_count", r->object_count);
2516 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);
2517 ndr_print_ptr(ndr, "first_object", r->first_object);
2518 ndr->depth++;
2519 if (r->first_object) {
2520 ndr_print_drsuapi_DsReplicaObjectListItemEx(ndr, "first_object", r->first_object);
2522 ndr->depth--;
2523 ndr_print_uint32(ndr, "more_data", r->more_data);
2524 ndr->depth--;
2527 _PUBLIC_ size_t ndr_size_drsuapi_DsGetNCChangesCtr1(const struct drsuapi_DsGetNCChangesCtr1 *r, struct smb_iconv_convenience *ic, int flags)
2529 return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsGetNCChangesCtr1, ic);
2532 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsLinkedAttributeFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
2534 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
2535 return NDR_ERR_SUCCESS;
2538 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsLinkedAttributeFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
2540 uint32_t v;
2541 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
2542 *r = v;
2543 return NDR_ERR_SUCCESS;
2546 _PUBLIC_ void ndr_print_drsuapi_DsLinkedAttributeFlags(struct ndr_print *ndr, const char *name, uint32_t r)
2548 ndr_print_uint32(ndr, name, r);
2549 ndr->depth++;
2550 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_LINKED_ATTRIBUTE_FLAG_ACTIVE", DRSUAPI_DS_LINKED_ATTRIBUTE_FLAG_ACTIVE, r);
2551 ndr->depth--;
2554 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaLinkedAttribute(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaLinkedAttribute *r)
2556 if (ndr_flags & NDR_SCALARS) {
2557 NDR_CHECK(ndr_push_align(ndr, 8));
2558 NDR_CHECK(ndr_push_unique_ptr(ndr, r->identifier));
2559 NDR_CHECK(ndr_push_drsuapi_DsAttributeId(ndr, NDR_SCALARS, r->attid));
2560 NDR_CHECK(ndr_push_drsuapi_DsAttributeValue(ndr, NDR_SCALARS, &r->value));
2561 NDR_CHECK(ndr_push_drsuapi_DsLinkedAttributeFlags(ndr, NDR_SCALARS, r->flags));
2562 NDR_CHECK(ndr_push_NTTIME_1sec(ndr, NDR_SCALARS, r->originating_add_time));
2563 NDR_CHECK(ndr_push_drsuapi_DsReplicaMetaData(ndr, NDR_SCALARS, &r->meta_data));
2565 if (ndr_flags & NDR_BUFFERS) {
2566 if (r->identifier) {
2567 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->identifier));
2569 NDR_CHECK(ndr_push_drsuapi_DsAttributeValue(ndr, NDR_BUFFERS, &r->value));
2571 return NDR_ERR_SUCCESS;
2574 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaLinkedAttribute(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaLinkedAttribute *r)
2576 uint32_t _ptr_identifier;
2577 TALLOC_CTX *_mem_save_identifier_0;
2578 if (ndr_flags & NDR_SCALARS) {
2579 NDR_CHECK(ndr_pull_align(ndr, 8));
2580 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_identifier));
2581 if (_ptr_identifier) {
2582 NDR_PULL_ALLOC(ndr, r->identifier);
2583 } else {
2584 r->identifier = NULL;
2586 NDR_CHECK(ndr_pull_drsuapi_DsAttributeId(ndr, NDR_SCALARS, &r->attid));
2587 NDR_CHECK(ndr_pull_drsuapi_DsAttributeValue(ndr, NDR_SCALARS, &r->value));
2588 NDR_CHECK(ndr_pull_drsuapi_DsLinkedAttributeFlags(ndr, NDR_SCALARS, &r->flags));
2589 NDR_CHECK(ndr_pull_NTTIME_1sec(ndr, NDR_SCALARS, &r->originating_add_time));
2590 NDR_CHECK(ndr_pull_drsuapi_DsReplicaMetaData(ndr, NDR_SCALARS, &r->meta_data));
2592 if (ndr_flags & NDR_BUFFERS) {
2593 if (r->identifier) {
2594 _mem_save_identifier_0 = NDR_PULL_GET_MEM_CTX(ndr);
2595 NDR_PULL_SET_MEM_CTX(ndr, r->identifier, 0);
2596 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->identifier));
2597 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_identifier_0, 0);
2599 NDR_CHECK(ndr_pull_drsuapi_DsAttributeValue(ndr, NDR_BUFFERS, &r->value));
2601 return NDR_ERR_SUCCESS;
2604 _PUBLIC_ void ndr_print_drsuapi_DsReplicaLinkedAttribute(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaLinkedAttribute *r)
2606 ndr_print_struct(ndr, name, "drsuapi_DsReplicaLinkedAttribute");
2607 ndr->depth++;
2608 ndr_print_ptr(ndr, "identifier", r->identifier);
2609 ndr->depth++;
2610 if (r->identifier) {
2611 ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "identifier", r->identifier);
2613 ndr->depth--;
2614 ndr_print_drsuapi_DsAttributeId(ndr, "attid", r->attid);
2615 ndr_print_drsuapi_DsAttributeValue(ndr, "value", &r->value);
2616 ndr_print_drsuapi_DsLinkedAttributeFlags(ndr, "flags", r->flags);
2617 ndr_print_NTTIME_1sec(ndr, "originating_add_time", r->originating_add_time);
2618 ndr_print_drsuapi_DsReplicaMetaData(ndr, "meta_data", &r->meta_data);
2619 ndr->depth--;
2622 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr6(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesCtr6 *r)
2624 uint32_t cntr_linked_attributes_1;
2625 if (ndr_flags & NDR_SCALARS) {
2626 NDR_CHECK(ndr_push_align(ndr, 8));
2627 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_guid));
2628 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
2629 NDR_CHECK(ndr_push_unique_ptr(ndr, r->naming_context));
2630 NDR_CHECK(ndr_push_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->old_highwatermark));
2631 NDR_CHECK(ndr_push_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->new_highwatermark));
2632 NDR_CHECK(ndr_push_unique_ptr(ndr, r->uptodateness_vector));
2633 NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_SCALARS, &r->mapping_ctr));
2634 NDR_CHECK(ndr_push_drsuapi_DsExtendedError(ndr, NDR_SCALARS, r->extended_ret));
2635 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->object_count));
2636 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_drsuapi_DsGetNCChangesCtr6(r, ndr->iconv_convenience, ndr->flags) + 55));
2637 NDR_CHECK(ndr_push_unique_ptr(ndr, r->first_object));
2638 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->more_data));
2639 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->nc_object_count));
2640 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->nc_linked_attributes_count));
2641 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->linked_attributes_count));
2642 NDR_CHECK(ndr_push_unique_ptr(ndr, r->linked_attributes));
2643 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->drs_error));
2645 if (ndr_flags & NDR_BUFFERS) {
2646 if (r->naming_context) {
2647 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
2649 if (r->uptodateness_vector) {
2650 NDR_CHECK(ndr_push_drsuapi_DsReplicaCursor2CtrEx(ndr, NDR_SCALARS, r->uptodateness_vector));
2652 NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->mapping_ctr));
2653 if (r->first_object) {
2654 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectListItemEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->first_object));
2656 if (r->linked_attributes) {
2657 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->linked_attributes_count));
2658 for (cntr_linked_attributes_1 = 0; cntr_linked_attributes_1 < r->linked_attributes_count; cntr_linked_attributes_1++) {
2659 NDR_CHECK(ndr_push_drsuapi_DsReplicaLinkedAttribute(ndr, NDR_SCALARS, &r->linked_attributes[cntr_linked_attributes_1]));
2661 for (cntr_linked_attributes_1 = 0; cntr_linked_attributes_1 < r->linked_attributes_count; cntr_linked_attributes_1++) {
2662 NDR_CHECK(ndr_push_drsuapi_DsReplicaLinkedAttribute(ndr, NDR_BUFFERS, &r->linked_attributes[cntr_linked_attributes_1]));
2666 return NDR_ERR_SUCCESS;
2669 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr6(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesCtr6 *r)
2671 uint32_t _ptr_naming_context;
2672 TALLOC_CTX *_mem_save_naming_context_0;
2673 uint32_t _ptr_uptodateness_vector;
2674 TALLOC_CTX *_mem_save_uptodateness_vector_0;
2675 uint32_t _ptr_first_object;
2676 TALLOC_CTX *_mem_save_first_object_0;
2677 uint32_t _ptr_linked_attributes;
2678 uint32_t cntr_linked_attributes_1;
2679 TALLOC_CTX *_mem_save_linked_attributes_0;
2680 TALLOC_CTX *_mem_save_linked_attributes_1;
2681 if (ndr_flags & NDR_SCALARS) {
2682 NDR_CHECK(ndr_pull_align(ndr, 8));
2683 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_guid));
2684 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
2685 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_naming_context));
2686 if (_ptr_naming_context) {
2687 NDR_PULL_ALLOC(ndr, r->naming_context);
2688 } else {
2689 r->naming_context = NULL;
2691 NDR_CHECK(ndr_pull_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->old_highwatermark));
2692 NDR_CHECK(ndr_pull_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->new_highwatermark));
2693 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_uptodateness_vector));
2694 if (_ptr_uptodateness_vector) {
2695 NDR_PULL_ALLOC(ndr, r->uptodateness_vector);
2696 } else {
2697 r->uptodateness_vector = NULL;
2699 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_SCALARS, &r->mapping_ctr));
2700 NDR_CHECK(ndr_pull_drsuapi_DsExtendedError(ndr, NDR_SCALARS, &r->extended_ret));
2701 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->object_count));
2702 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size));
2703 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_first_object));
2704 if (_ptr_first_object) {
2705 NDR_PULL_ALLOC(ndr, r->first_object);
2706 } else {
2707 r->first_object = NULL;
2709 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->more_data));
2710 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->nc_object_count));
2711 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->nc_linked_attributes_count));
2712 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->linked_attributes_count));
2713 if (r->linked_attributes_count > 1048576) {
2714 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
2716 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_linked_attributes));
2717 if (_ptr_linked_attributes) {
2718 NDR_PULL_ALLOC(ndr, r->linked_attributes);
2719 } else {
2720 r->linked_attributes = NULL;
2722 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->drs_error));
2724 if (ndr_flags & NDR_BUFFERS) {
2725 if (r->naming_context) {
2726 _mem_save_naming_context_0 = NDR_PULL_GET_MEM_CTX(ndr);
2727 NDR_PULL_SET_MEM_CTX(ndr, r->naming_context, 0);
2728 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
2729 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_naming_context_0, 0);
2731 if (r->uptodateness_vector) {
2732 _mem_save_uptodateness_vector_0 = NDR_PULL_GET_MEM_CTX(ndr);
2733 NDR_PULL_SET_MEM_CTX(ndr, r->uptodateness_vector, 0);
2734 NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursor2CtrEx(ndr, NDR_SCALARS, r->uptodateness_vector));
2735 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_uptodateness_vector_0, 0);
2737 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->mapping_ctr));
2738 if (r->first_object) {
2739 _mem_save_first_object_0 = NDR_PULL_GET_MEM_CTX(ndr);
2740 NDR_PULL_SET_MEM_CTX(ndr, r->first_object, 0);
2741 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectListItemEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->first_object));
2742 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_first_object_0, 0);
2744 if (r->linked_attributes) {
2745 _mem_save_linked_attributes_0 = NDR_PULL_GET_MEM_CTX(ndr);
2746 NDR_PULL_SET_MEM_CTX(ndr, r->linked_attributes, 0);
2747 NDR_CHECK(ndr_pull_array_size(ndr, &r->linked_attributes));
2748 NDR_PULL_ALLOC_N(ndr, r->linked_attributes, ndr_get_array_size(ndr, &r->linked_attributes));
2749 _mem_save_linked_attributes_1 = NDR_PULL_GET_MEM_CTX(ndr);
2750 NDR_PULL_SET_MEM_CTX(ndr, r->linked_attributes, 0);
2751 for (cntr_linked_attributes_1 = 0; cntr_linked_attributes_1 < r->linked_attributes_count; cntr_linked_attributes_1++) {
2752 NDR_CHECK(ndr_pull_drsuapi_DsReplicaLinkedAttribute(ndr, NDR_SCALARS, &r->linked_attributes[cntr_linked_attributes_1]));
2754 for (cntr_linked_attributes_1 = 0; cntr_linked_attributes_1 < r->linked_attributes_count; cntr_linked_attributes_1++) {
2755 NDR_CHECK(ndr_pull_drsuapi_DsReplicaLinkedAttribute(ndr, NDR_BUFFERS, &r->linked_attributes[cntr_linked_attributes_1]));
2757 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_linked_attributes_1, 0);
2758 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_linked_attributes_0, 0);
2760 if (r->linked_attributes) {
2761 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->linked_attributes, r->linked_attributes_count));
2764 return NDR_ERR_SUCCESS;
2767 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCtr6(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr6 *r)
2769 uint32_t cntr_linked_attributes_1;
2770 ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesCtr6");
2771 ndr->depth++;
2772 ndr_print_GUID(ndr, "source_dsa_guid", &r->source_dsa_guid);
2773 ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id);
2774 ndr_print_ptr(ndr, "naming_context", r->naming_context);
2775 ndr->depth++;
2776 if (r->naming_context) {
2777 ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "naming_context", r->naming_context);
2779 ndr->depth--;
2780 ndr_print_drsuapi_DsReplicaHighWaterMark(ndr, "old_highwatermark", &r->old_highwatermark);
2781 ndr_print_drsuapi_DsReplicaHighWaterMark(ndr, "new_highwatermark", &r->new_highwatermark);
2782 ndr_print_ptr(ndr, "uptodateness_vector", r->uptodateness_vector);
2783 ndr->depth++;
2784 if (r->uptodateness_vector) {
2785 ndr_print_drsuapi_DsReplicaCursor2CtrEx(ndr, "uptodateness_vector", r->uptodateness_vector);
2787 ndr->depth--;
2788 ndr_print_drsuapi_DsReplicaOIDMapping_Ctr(ndr, "mapping_ctr", &r->mapping_ctr);
2789 ndr_print_drsuapi_DsExtendedError(ndr, "extended_ret", r->extended_ret);
2790 ndr_print_uint32(ndr, "object_count", r->object_count);
2791 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);
2792 ndr_print_ptr(ndr, "first_object", r->first_object);
2793 ndr->depth++;
2794 if (r->first_object) {
2795 ndr_print_drsuapi_DsReplicaObjectListItemEx(ndr, "first_object", r->first_object);
2797 ndr->depth--;
2798 ndr_print_uint32(ndr, "more_data", r->more_data);
2799 ndr_print_uint32(ndr, "nc_object_count", r->nc_object_count);
2800 ndr_print_uint32(ndr, "nc_linked_attributes_count", r->nc_linked_attributes_count);
2801 ndr_print_uint32(ndr, "linked_attributes_count", r->linked_attributes_count);
2802 ndr_print_ptr(ndr, "linked_attributes", r->linked_attributes);
2803 ndr->depth++;
2804 if (r->linked_attributes) {
2805 ndr->print(ndr, "%s: ARRAY(%d)", "linked_attributes", (int)r->linked_attributes_count);
2806 ndr->depth++;
2807 for (cntr_linked_attributes_1=0;cntr_linked_attributes_1<r->linked_attributes_count;cntr_linked_attributes_1++) {
2808 char *idx_1=NULL;
2809 if (asprintf(&idx_1, "[%d]", cntr_linked_attributes_1) != -1) {
2810 ndr_print_drsuapi_DsReplicaLinkedAttribute(ndr, "linked_attributes", &r->linked_attributes[cntr_linked_attributes_1]);
2811 free(idx_1);
2814 ndr->depth--;
2816 ndr->depth--;
2817 ndr_print_WERROR(ndr, "drs_error", r->drs_error);
2818 ndr->depth--;
2821 _PUBLIC_ size_t ndr_size_drsuapi_DsGetNCChangesCtr6(const struct drsuapi_DsGetNCChangesCtr6 *r, struct smb_iconv_convenience *ic, int flags)
2823 return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsGetNCChangesCtr6, ic);
2826 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr1TS(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesCtr1TS *r)
2828 if (ndr_flags & NDR_SCALARS) {
2829 NDR_CHECK(ndr_push_align(ndr, 1));
2831 struct ndr_push *_ndr_ctr1;
2832 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_ctr1, 0xFFFFFC01, -1));
2833 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr1(_ndr_ctr1, NDR_SCALARS|NDR_BUFFERS, &r->ctr1));
2834 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_ctr1, 0xFFFFFC01, -1));
2837 if (ndr_flags & NDR_BUFFERS) {
2839 return NDR_ERR_SUCCESS;
2842 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr1TS(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesCtr1TS *r)
2844 if (ndr_flags & NDR_SCALARS) {
2845 NDR_CHECK(ndr_pull_align(ndr, 1));
2847 struct ndr_pull *_ndr_ctr1;
2848 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_ctr1, 0xFFFFFC01, -1));
2849 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr1(_ndr_ctr1, NDR_SCALARS|NDR_BUFFERS, &r->ctr1));
2850 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_ctr1, 0xFFFFFC01, -1));
2853 if (ndr_flags & NDR_BUFFERS) {
2855 return NDR_ERR_SUCCESS;
2858 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCtr1TS(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr1TS *r)
2860 ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesCtr1TS");
2861 ndr->depth++;
2862 ndr_print_drsuapi_DsGetNCChangesCtr1(ndr, "ctr1", &r->ctr1);
2863 ndr->depth--;
2866 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr6TS(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesCtr6TS *r)
2868 if (ndr_flags & NDR_SCALARS) {
2869 NDR_CHECK(ndr_push_align(ndr, 1));
2871 struct ndr_push *_ndr_ctr6;
2872 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_ctr6, 0xFFFFFC01, -1));
2873 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr6(_ndr_ctr6, NDR_SCALARS|NDR_BUFFERS, &r->ctr6));
2874 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_ctr6, 0xFFFFFC01, -1));
2877 if (ndr_flags & NDR_BUFFERS) {
2879 return NDR_ERR_SUCCESS;
2882 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr6TS(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesCtr6TS *r)
2884 if (ndr_flags & NDR_SCALARS) {
2885 NDR_CHECK(ndr_pull_align(ndr, 1));
2887 struct ndr_pull *_ndr_ctr6;
2888 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_ctr6, 0xFFFFFC01, -1));
2889 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr6(_ndr_ctr6, NDR_SCALARS|NDR_BUFFERS, &r->ctr6));
2890 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_ctr6, 0xFFFFFC01, -1));
2893 if (ndr_flags & NDR_BUFFERS) {
2895 return NDR_ERR_SUCCESS;
2898 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCtr6TS(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr6TS *r)
2900 ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesCtr6TS");
2901 ndr->depth++;
2902 ndr_print_drsuapi_DsGetNCChangesCtr6(ndr, "ctr6", &r->ctr6);
2903 ndr->depth--;
2906 static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesMSZIPCtr1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesMSZIPCtr1 *r)
2908 uint32_t _ptr_ts;
2909 TALLOC_CTX *_mem_save_ts_0;
2910 if (ndr_flags & NDR_SCALARS) {
2911 NDR_CHECK(ndr_pull_align(ndr, 4));
2912 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->decompressed_length));
2913 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->compressed_length));
2914 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ts));
2915 if (_ptr_ts) {
2916 NDR_PULL_ALLOC(ndr, r->ts);
2917 } else {
2918 r->ts = NULL;
2921 if (ndr_flags & NDR_BUFFERS) {
2922 if (r->ts) {
2923 _mem_save_ts_0 = NDR_PULL_GET_MEM_CTX(ndr);
2924 NDR_PULL_SET_MEM_CTX(ndr, r->ts, 0);
2926 struct ndr_pull *_ndr_ts;
2927 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_ts, 4, r->compressed_length));
2929 struct ndr_pull *_ndr_ts_compressed;
2930 NDR_CHECK(ndr_pull_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_MSZIP, r->decompressed_length));
2931 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr1TS(_ndr_ts_compressed, NDR_SCALARS|NDR_BUFFERS, r->ts));
2932 NDR_CHECK(ndr_pull_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_MSZIP, r->decompressed_length));
2934 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_ts, 4, r->compressed_length));
2936 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ts_0, 0);
2939 return NDR_ERR_SUCCESS;
2942 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesMSZIPCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesMSZIPCtr1 *r)
2944 ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesMSZIPCtr1");
2945 ndr->depth++;
2946 ndr_print_uint32(ndr, "decompressed_length", r->decompressed_length);
2947 ndr_print_uint32(ndr, "compressed_length", r->compressed_length);
2948 ndr_print_ptr(ndr, "ts", r->ts);
2949 ndr->depth++;
2950 if (r->ts) {
2951 ndr_print_drsuapi_DsGetNCChangesCtr1TS(ndr, "ts", r->ts);
2953 ndr->depth--;
2954 ndr->depth--;
2957 static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesMSZIPCtr6(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesMSZIPCtr6 *r)
2959 uint32_t _ptr_ts;
2960 TALLOC_CTX *_mem_save_ts_0;
2961 if (ndr_flags & NDR_SCALARS) {
2962 NDR_CHECK(ndr_pull_align(ndr, 4));
2963 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->decompressed_length));
2964 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->compressed_length));
2965 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ts));
2966 if (_ptr_ts) {
2967 NDR_PULL_ALLOC(ndr, r->ts);
2968 } else {
2969 r->ts = NULL;
2972 if (ndr_flags & NDR_BUFFERS) {
2973 if (r->ts) {
2974 _mem_save_ts_0 = NDR_PULL_GET_MEM_CTX(ndr);
2975 NDR_PULL_SET_MEM_CTX(ndr, r->ts, 0);
2977 struct ndr_pull *_ndr_ts;
2978 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_ts, 4, r->compressed_length));
2980 struct ndr_pull *_ndr_ts_compressed;
2981 NDR_CHECK(ndr_pull_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_MSZIP, r->decompressed_length));
2982 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr6TS(_ndr_ts_compressed, NDR_SCALARS|NDR_BUFFERS, r->ts));
2983 NDR_CHECK(ndr_pull_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_MSZIP, r->decompressed_length));
2985 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_ts, 4, r->compressed_length));
2987 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ts_0, 0);
2990 return NDR_ERR_SUCCESS;
2993 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesMSZIPCtr6(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesMSZIPCtr6 *r)
2995 ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesMSZIPCtr6");
2996 ndr->depth++;
2997 ndr_print_uint32(ndr, "decompressed_length", r->decompressed_length);
2998 ndr_print_uint32(ndr, "compressed_length", r->compressed_length);
2999 ndr_print_ptr(ndr, "ts", r->ts);
3000 ndr->depth++;
3001 if (r->ts) {
3002 ndr_print_drsuapi_DsGetNCChangesCtr6TS(ndr, "ts", r->ts);
3004 ndr->depth--;
3005 ndr->depth--;
3008 static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesXPRESSCtr1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesXPRESSCtr1 *r)
3010 uint32_t _ptr_ts;
3011 TALLOC_CTX *_mem_save_ts_0;
3012 if (ndr_flags & NDR_SCALARS) {
3013 NDR_CHECK(ndr_pull_align(ndr, 4));
3014 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->decompressed_length));
3015 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->compressed_length));
3016 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ts));
3017 if (_ptr_ts) {
3018 NDR_PULL_ALLOC(ndr, r->ts);
3019 } else {
3020 r->ts = NULL;
3023 if (ndr_flags & NDR_BUFFERS) {
3024 if (r->ts) {
3025 _mem_save_ts_0 = NDR_PULL_GET_MEM_CTX(ndr);
3026 NDR_PULL_SET_MEM_CTX(ndr, r->ts, 0);
3028 struct ndr_pull *_ndr_ts;
3029 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_ts, 4, r->compressed_length));
3031 struct ndr_pull *_ndr_ts_compressed;
3032 NDR_CHECK(ndr_pull_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_XPRESS, r->decompressed_length));
3033 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr1TS(_ndr_ts_compressed, NDR_SCALARS|NDR_BUFFERS, r->ts));
3034 NDR_CHECK(ndr_pull_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_XPRESS, r->decompressed_length));
3036 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_ts, 4, r->compressed_length));
3038 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ts_0, 0);
3041 return NDR_ERR_SUCCESS;
3044 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesXPRESSCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesXPRESSCtr1 *r)
3046 ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesXPRESSCtr1");
3047 ndr->depth++;
3048 ndr_print_uint32(ndr, "decompressed_length", r->decompressed_length);
3049 ndr_print_uint32(ndr, "compressed_length", r->compressed_length);
3050 ndr_print_ptr(ndr, "ts", r->ts);
3051 ndr->depth++;
3052 if (r->ts) {
3053 ndr_print_drsuapi_DsGetNCChangesCtr1TS(ndr, "ts", r->ts);
3055 ndr->depth--;
3056 ndr->depth--;
3059 static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesXPRESSCtr6(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesXPRESSCtr6 *r)
3061 uint32_t _ptr_ts;
3062 TALLOC_CTX *_mem_save_ts_0;
3063 if (ndr_flags & NDR_SCALARS) {
3064 NDR_CHECK(ndr_pull_align(ndr, 4));
3065 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->decompressed_length));
3066 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->compressed_length));
3067 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ts));
3068 if (_ptr_ts) {
3069 NDR_PULL_ALLOC(ndr, r->ts);
3070 } else {
3071 r->ts = NULL;
3074 if (ndr_flags & NDR_BUFFERS) {
3075 if (r->ts) {
3076 _mem_save_ts_0 = NDR_PULL_GET_MEM_CTX(ndr);
3077 NDR_PULL_SET_MEM_CTX(ndr, r->ts, 0);
3079 struct ndr_pull *_ndr_ts;
3080 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_ts, 4, r->compressed_length));
3082 struct ndr_pull *_ndr_ts_compressed;
3083 NDR_CHECK(ndr_pull_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_XPRESS, r->decompressed_length));
3084 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr6TS(_ndr_ts_compressed, NDR_SCALARS|NDR_BUFFERS, r->ts));
3085 NDR_CHECK(ndr_pull_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_XPRESS, r->decompressed_length));
3087 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_ts, 4, r->compressed_length));
3089 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ts_0, 0);
3092 return NDR_ERR_SUCCESS;
3095 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesXPRESSCtr6(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesXPRESSCtr6 *r)
3097 ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesXPRESSCtr6");
3098 ndr->depth++;
3099 ndr_print_uint32(ndr, "decompressed_length", r->decompressed_length);
3100 ndr_print_uint32(ndr, "compressed_length", r->compressed_length);
3101 ndr_print_ptr(ndr, "ts", r->ts);
3102 ndr->depth++;
3103 if (r->ts) {
3104 ndr_print_drsuapi_DsGetNCChangesCtr6TS(ndr, "ts", r->ts);
3106 ndr->depth--;
3107 ndr->depth--;
3110 static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCompressionType(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsGetNCChangesCompressionType r)
3112 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r));
3113 return NDR_ERR_SUCCESS;
3116 static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCompressionType(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsGetNCChangesCompressionType *r)
3118 uint16_t v;
3119 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v));
3120 *r = v;
3121 return NDR_ERR_SUCCESS;
3124 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCompressionType(struct ndr_print *ndr, const char *name, enum drsuapi_DsGetNCChangesCompressionType r)
3126 const char *val = NULL;
3128 switch (r) {
3129 case DRSUAPI_COMPRESSION_TYPE_MSZIP: val = "DRSUAPI_COMPRESSION_TYPE_MSZIP"; break;
3130 case DRSUAPI_COMPRESSION_TYPE_XPRESS: val = "DRSUAPI_COMPRESSION_TYPE_XPRESS"; break;
3132 ndr_print_enum(ndr, name, "ENUM", val, r);
3135 static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCompressedCtr(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetNCChangesCompressedCtr *r)
3138 uint32_t _flags_save_UNION = ndr->flags;
3139 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
3140 if (ndr_flags & NDR_SCALARS) {
3141 int level = ndr_push_get_switch_value(ndr, r);
3142 switch (level) {
3143 case 1|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16): {
3144 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesMSZIPCtr1(ndr, NDR_SCALARS, &r->mszip1));
3145 break; }
3147 case 6|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16): {
3148 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesMSZIPCtr6(ndr, NDR_SCALARS, &r->mszip6));
3149 break; }
3151 case 1|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16): {
3152 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesXPRESSCtr1(ndr, NDR_SCALARS, &r->xpress1));
3153 break; }
3155 case 6|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16): {
3156 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesXPRESSCtr6(ndr, NDR_SCALARS, &r->xpress6));
3157 break; }
3159 default:
3160 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
3163 if (ndr_flags & NDR_BUFFERS) {
3164 int level = ndr_push_get_switch_value(ndr, r);
3165 switch (level) {
3166 case 1|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16):
3167 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesMSZIPCtr1(ndr, NDR_BUFFERS, &r->mszip1));
3168 break;
3170 case 6|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16):
3171 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesMSZIPCtr6(ndr, NDR_BUFFERS, &r->mszip6));
3172 break;
3174 case 1|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16):
3175 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesXPRESSCtr1(ndr, NDR_BUFFERS, &r->xpress1));
3176 break;
3178 case 6|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16):
3179 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesXPRESSCtr6(ndr, NDR_BUFFERS, &r->xpress6));
3180 break;
3182 default:
3183 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
3186 ndr->flags = _flags_save_UNION;
3188 return NDR_ERR_SUCCESS;
3191 static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCompressedCtr(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetNCChangesCompressedCtr *r)
3193 int level;
3195 uint32_t _flags_save_UNION = ndr->flags;
3196 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
3197 level = ndr_pull_get_switch_value(ndr, r);
3198 if (ndr_flags & NDR_SCALARS) {
3199 switch (level) {
3200 case 1|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16): {
3201 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesMSZIPCtr1(ndr, NDR_SCALARS, &r->mszip1));
3202 break; }
3204 case 6|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16): {
3205 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesMSZIPCtr6(ndr, NDR_SCALARS, &r->mszip6));
3206 break; }
3208 case 1|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16): {
3209 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesXPRESSCtr1(ndr, NDR_SCALARS, &r->xpress1));
3210 break; }
3212 case 6|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16): {
3213 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesXPRESSCtr6(ndr, NDR_SCALARS, &r->xpress6));
3214 break; }
3216 default:
3217 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
3220 if (ndr_flags & NDR_BUFFERS) {
3221 switch (level) {
3222 case 1|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16):
3223 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesMSZIPCtr1(ndr, NDR_BUFFERS, &r->mszip1));
3224 break;
3226 case 6|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16):
3227 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesMSZIPCtr6(ndr, NDR_BUFFERS, &r->mszip6));
3228 break;
3230 case 1|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16):
3231 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesXPRESSCtr1(ndr, NDR_BUFFERS, &r->xpress1));
3232 break;
3234 case 6|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16):
3235 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesXPRESSCtr6(ndr, NDR_BUFFERS, &r->xpress6));
3236 break;
3238 default:
3239 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
3242 ndr->flags = _flags_save_UNION;
3244 return NDR_ERR_SUCCESS;
3247 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCompressedCtr(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetNCChangesCompressedCtr *r)
3249 int level;
3251 uint32_t _flags_save_UNION = ndr->flags;
3252 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
3253 level = ndr_print_get_switch_value(ndr, r);
3254 ndr_print_union(ndr, name, level, "drsuapi_DsGetNCChangesCompressedCtr");
3255 switch (level) {
3256 case 1|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16):
3257 ndr_print_drsuapi_DsGetNCChangesMSZIPCtr1(ndr, "mszip1", &r->mszip1);
3258 break;
3260 case 6|(DRSUAPI_COMPRESSION_TYPE_MSZIP<<16):
3261 ndr_print_drsuapi_DsGetNCChangesMSZIPCtr6(ndr, "mszip6", &r->mszip6);
3262 break;
3264 case 1|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16):
3265 ndr_print_drsuapi_DsGetNCChangesXPRESSCtr1(ndr, "xpress1", &r->xpress1);
3266 break;
3268 case 6|(DRSUAPI_COMPRESSION_TYPE_XPRESS<<16):
3269 ndr_print_drsuapi_DsGetNCChangesXPRESSCtr6(ndr, "xpress6", &r->xpress6);
3270 break;
3272 default:
3273 ndr_print_bad_level(ndr, name, level);
3275 ndr->flags = _flags_save_UNION;
3279 static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesCtr2 *r)
3281 if (ndr_flags & NDR_SCALARS) {
3282 NDR_CHECK(ndr_push_align(ndr, 4));
3283 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesMSZIPCtr1(ndr, NDR_SCALARS, &r->mszip1));
3285 if (ndr_flags & NDR_BUFFERS) {
3286 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesMSZIPCtr1(ndr, NDR_BUFFERS, &r->mszip1));
3288 return NDR_ERR_SUCCESS;
3291 static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesCtr2 *r)
3293 if (ndr_flags & NDR_SCALARS) {
3294 NDR_CHECK(ndr_pull_align(ndr, 4));
3295 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesMSZIPCtr1(ndr, NDR_SCALARS, &r->mszip1));
3297 if (ndr_flags & NDR_BUFFERS) {
3298 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesMSZIPCtr1(ndr, NDR_BUFFERS, &r->mszip1));
3300 return NDR_ERR_SUCCESS;
3303 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCtr2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr2 *r)
3305 ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesCtr2");
3306 ndr->depth++;
3307 ndr_print_drsuapi_DsGetNCChangesMSZIPCtr1(ndr, "mszip1", &r->mszip1);
3308 ndr->depth--;
3311 static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr7(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesCtr7 *r)
3313 if (ndr_flags & NDR_SCALARS) {
3314 NDR_CHECK(ndr_push_align(ndr, 4));
3315 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->level));
3316 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCompressionType(ndr, NDR_SCALARS, r->type));
3317 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->ctr, r->level | (r->type << 16)));
3318 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCompressedCtr(ndr, NDR_SCALARS, &r->ctr));
3320 if (ndr_flags & NDR_BUFFERS) {
3321 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCompressedCtr(ndr, NDR_BUFFERS, &r->ctr));
3323 return NDR_ERR_SUCCESS;
3326 static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr7(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesCtr7 *r)
3328 if (ndr_flags & NDR_SCALARS) {
3329 NDR_CHECK(ndr_pull_align(ndr, 4));
3330 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->level));
3331 if (r->level < 0 || r->level > 6) {
3332 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
3334 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCompressionType(ndr, NDR_SCALARS, &r->type));
3335 if (r->type < 2 || r->type > 3) {
3336 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
3338 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->ctr, r->level | (r->type << 16)));
3339 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCompressedCtr(ndr, NDR_SCALARS, &r->ctr));
3341 if (ndr_flags & NDR_BUFFERS) {
3342 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCompressedCtr(ndr, NDR_BUFFERS, &r->ctr));
3344 return NDR_ERR_SUCCESS;
3347 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCtr7(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr7 *r)
3349 ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesCtr7");
3350 ndr->depth++;
3351 ndr_print_int32(ndr, "level", r->level);
3352 ndr_print_drsuapi_DsGetNCChangesCompressionType(ndr, "type", r->type);
3353 ndr_print_set_switch_value(ndr, &r->ctr, r->level | (r->type << 16));
3354 ndr_print_drsuapi_DsGetNCChangesCompressedCtr(ndr, "ctr", &r->ctr);
3355 ndr->depth--;
3358 static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetNCChangesCtr *r)
3360 if (ndr_flags & NDR_SCALARS) {
3361 int level = ndr_push_get_switch_value(ndr, r);
3362 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
3363 switch (level) {
3364 case 1: {
3365 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr1(ndr, NDR_SCALARS, &r->ctr1));
3366 break; }
3368 case 2: {
3369 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr2(ndr, NDR_SCALARS, &r->ctr2));
3370 break; }
3372 case 6: {
3373 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr6(ndr, NDR_SCALARS, &r->ctr6));
3374 break; }
3376 case 7: {
3377 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr7(ndr, NDR_SCALARS, &r->ctr7));
3378 break; }
3380 default:
3381 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
3384 if (ndr_flags & NDR_BUFFERS) {
3385 int level = ndr_push_get_switch_value(ndr, r);
3386 switch (level) {
3387 case 1:
3388 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr1(ndr, NDR_BUFFERS, &r->ctr1));
3389 break;
3391 case 2:
3392 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr2(ndr, NDR_BUFFERS, &r->ctr2));
3393 break;
3395 case 6:
3396 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr6(ndr, NDR_BUFFERS, &r->ctr6));
3397 break;
3399 case 7:
3400 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr7(ndr, NDR_BUFFERS, &r->ctr7));
3401 break;
3403 default:
3404 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
3407 return NDR_ERR_SUCCESS;
3410 static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetNCChangesCtr *r)
3412 int level;
3413 int32_t _level;
3414 level = ndr_pull_get_switch_value(ndr, r);
3415 if (ndr_flags & NDR_SCALARS) {
3416 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
3417 if (_level != level) {
3418 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
3420 switch (level) {
3421 case 1: {
3422 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr1(ndr, NDR_SCALARS, &r->ctr1));
3423 break; }
3425 case 2: {
3426 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr2(ndr, NDR_SCALARS, &r->ctr2));
3427 break; }
3429 case 6: {
3430 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr6(ndr, NDR_SCALARS, &r->ctr6));
3431 break; }
3433 case 7: {
3434 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr7(ndr, NDR_SCALARS, &r->ctr7));
3435 break; }
3437 default:
3438 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
3441 if (ndr_flags & NDR_BUFFERS) {
3442 switch (level) {
3443 case 1:
3444 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr1(ndr, NDR_BUFFERS, &r->ctr1));
3445 break;
3447 case 2:
3448 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr2(ndr, NDR_BUFFERS, &r->ctr2));
3449 break;
3451 case 6:
3452 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr6(ndr, NDR_BUFFERS, &r->ctr6));
3453 break;
3455 case 7:
3456 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr7(ndr, NDR_BUFFERS, &r->ctr7));
3457 break;
3459 default:
3460 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
3463 return NDR_ERR_SUCCESS;
3466 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCtr(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetNCChangesCtr *r)
3468 int level;
3469 level = ndr_print_get_switch_value(ndr, r);
3470 ndr_print_union(ndr, name, level, "drsuapi_DsGetNCChangesCtr");
3471 switch (level) {
3472 case 1:
3473 ndr_print_drsuapi_DsGetNCChangesCtr1(ndr, "ctr1", &r->ctr1);
3474 break;
3476 case 2:
3477 ndr_print_drsuapi_DsGetNCChangesCtr2(ndr, "ctr2", &r->ctr2);
3478 break;
3480 case 6:
3481 ndr_print_drsuapi_DsGetNCChangesCtr6(ndr, "ctr6", &r->ctr6);
3482 break;
3484 case 7:
3485 ndr_print_drsuapi_DsGetNCChangesCtr7(ndr, "ctr7", &r->ctr7);
3486 break;
3488 default:
3489 ndr_print_bad_level(ndr, name, level);
3493 static enum ndr_err_code ndr_push_drsuapi_DsReplicaUpdateRefsOptions(struct ndr_push *ndr, int ndr_flags, uint32_t r)
3495 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
3496 return NDR_ERR_SUCCESS;
3499 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaUpdateRefsOptions(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
3501 uint32_t v;
3502 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
3503 *r = v;
3504 return NDR_ERR_SUCCESS;
3507 _PUBLIC_ void ndr_print_drsuapi_DsReplicaUpdateRefsOptions(struct ndr_print *ndr, const char *name, uint32_t r)
3509 ndr_print_uint32(ndr, name, r);
3510 ndr->depth++;
3511 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_UPDATE_ASYNCHRONOUS_OPERATION", DRSUAPI_DS_REPLICA_UPDATE_ASYNCHRONOUS_OPERATION, r);
3512 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_UPDATE_WRITEABLE", DRSUAPI_DS_REPLICA_UPDATE_WRITEABLE, r);
3513 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_UPDATE_ADD_REFERENCE", DRSUAPI_DS_REPLICA_UPDATE_ADD_REFERENCE, r);
3514 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_UPDATE_DELETE_REFERENCE", DRSUAPI_DS_REPLICA_UPDATE_DELETE_REFERENCE, r);
3515 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_UPDATE_0x00000010", DRSUAPI_DS_REPLICA_UPDATE_0x00000010, r);
3516 ndr->depth--;
3519 static enum ndr_err_code ndr_push_drsuapi_DsReplicaUpdateRefsRequest1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaUpdateRefsRequest1 *r)
3521 if (ndr_flags & NDR_SCALARS) {
3522 NDR_CHECK(ndr_push_align(ndr, 4));
3523 if (r->naming_context == NULL) {
3524 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
3526 NDR_CHECK(ndr_push_ref_ptr(ndr));
3527 if (r->dest_dsa_dns_name == NULL) {
3528 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
3530 NDR_CHECK(ndr_push_ref_ptr(ndr));
3531 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->dest_dsa_guid));
3532 NDR_CHECK(ndr_push_drsuapi_DsReplicaUpdateRefsOptions(ndr, NDR_SCALARS, r->options));
3534 if (ndr_flags & NDR_BUFFERS) {
3535 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
3536 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dest_dsa_dns_name, CH_DOS)));
3537 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
3538 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dest_dsa_dns_name, CH_DOS)));
3539 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));
3541 return NDR_ERR_SUCCESS;
3544 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaUpdateRefsRequest1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaUpdateRefsRequest1 *r)
3546 uint32_t _ptr_naming_context;
3547 TALLOC_CTX *_mem_save_naming_context_0;
3548 uint32_t _ptr_dest_dsa_dns_name;
3549 if (ndr_flags & NDR_SCALARS) {
3550 NDR_CHECK(ndr_pull_align(ndr, 4));
3551 NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_naming_context));
3552 if (_ptr_naming_context) {
3553 NDR_PULL_ALLOC(ndr, r->naming_context);
3554 } else {
3555 r->naming_context = NULL;
3557 NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_dest_dsa_dns_name));
3558 if (_ptr_dest_dsa_dns_name) {
3559 NDR_PULL_ALLOC(ndr, r->dest_dsa_dns_name);
3560 } else {
3561 r->dest_dsa_dns_name = NULL;
3563 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->dest_dsa_guid));
3564 NDR_CHECK(ndr_pull_drsuapi_DsReplicaUpdateRefsOptions(ndr, NDR_SCALARS, &r->options));
3566 if (ndr_flags & NDR_BUFFERS) {
3567 _mem_save_naming_context_0 = NDR_PULL_GET_MEM_CTX(ndr);
3568 NDR_PULL_SET_MEM_CTX(ndr, r->naming_context, 0);
3569 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
3570 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_naming_context_0, 0);
3571 NDR_CHECK(ndr_pull_array_size(ndr, &r->dest_dsa_dns_name));
3572 NDR_CHECK(ndr_pull_array_length(ndr, &r->dest_dsa_dns_name));
3573 if (ndr_get_array_length(ndr, &r->dest_dsa_dns_name) > ndr_get_array_size(ndr, &r->dest_dsa_dns_name)) {
3574 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));
3576 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dest_dsa_dns_name), sizeof(uint8_t)));
3577 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));
3579 return NDR_ERR_SUCCESS;
3582 _PUBLIC_ void ndr_print_drsuapi_DsReplicaUpdateRefsRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaUpdateRefsRequest1 *r)
3584 ndr_print_struct(ndr, name, "drsuapi_DsReplicaUpdateRefsRequest1");
3585 ndr->depth++;
3586 ndr_print_ptr(ndr, "naming_context", r->naming_context);
3587 ndr->depth++;
3588 ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "naming_context", r->naming_context);
3589 ndr->depth--;
3590 ndr_print_ptr(ndr, "dest_dsa_dns_name", r->dest_dsa_dns_name);
3591 ndr->depth++;
3592 ndr_print_string(ndr, "dest_dsa_dns_name", r->dest_dsa_dns_name);
3593 ndr->depth--;
3594 ndr_print_GUID(ndr, "dest_dsa_guid", &r->dest_dsa_guid);
3595 ndr_print_drsuapi_DsReplicaUpdateRefsOptions(ndr, "options", r->options);
3596 ndr->depth--;
3599 static enum ndr_err_code ndr_push_drsuapi_DsReplicaUpdateRefsRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsReplicaUpdateRefsRequest *r)
3601 if (ndr_flags & NDR_SCALARS) {
3602 int level = ndr_push_get_switch_value(ndr, r);
3603 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
3604 switch (level) {
3605 case 1: {
3606 NDR_CHECK(ndr_push_drsuapi_DsReplicaUpdateRefsRequest1(ndr, NDR_SCALARS, &r->req1));
3607 break; }
3609 default:
3610 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
3613 if (ndr_flags & NDR_BUFFERS) {
3614 int level = ndr_push_get_switch_value(ndr, r);
3615 switch (level) {
3616 case 1:
3617 NDR_CHECK(ndr_push_drsuapi_DsReplicaUpdateRefsRequest1(ndr, NDR_BUFFERS, &r->req1));
3618 break;
3620 default:
3621 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
3624 return NDR_ERR_SUCCESS;
3627 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaUpdateRefsRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsReplicaUpdateRefsRequest *r)
3629 int level;
3630 int32_t _level;
3631 level = ndr_pull_get_switch_value(ndr, r);
3632 if (ndr_flags & NDR_SCALARS) {
3633 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
3634 if (_level != level) {
3635 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
3637 switch (level) {
3638 case 1: {
3639 NDR_CHECK(ndr_pull_drsuapi_DsReplicaUpdateRefsRequest1(ndr, NDR_SCALARS, &r->req1));
3640 break; }
3642 default:
3643 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
3646 if (ndr_flags & NDR_BUFFERS) {
3647 switch (level) {
3648 case 1:
3649 NDR_CHECK(ndr_pull_drsuapi_DsReplicaUpdateRefsRequest1(ndr, NDR_BUFFERS, &r->req1));
3650 break;
3652 default:
3653 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
3656 return NDR_ERR_SUCCESS;
3659 _PUBLIC_ void ndr_print_drsuapi_DsReplicaUpdateRefsRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsReplicaUpdateRefsRequest *r)
3661 int level;
3662 level = ndr_print_get_switch_value(ndr, r);
3663 ndr_print_union(ndr, name, level, "drsuapi_DsReplicaUpdateRefsRequest");
3664 switch (level) {
3665 case 1:
3666 ndr_print_drsuapi_DsReplicaUpdateRefsRequest1(ndr, "req1", &r->req1);
3667 break;
3669 default:
3670 ndr_print_bad_level(ndr, name, level);
3674 static enum ndr_err_code ndr_push_drsuapi_DsReplicaAddOptions(struct ndr_push *ndr, int ndr_flags, uint32_t r)
3676 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
3677 return NDR_ERR_SUCCESS;
3680 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaAddOptions(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
3682 uint32_t v;
3683 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
3684 *r = v;
3685 return NDR_ERR_SUCCESS;
3688 _PUBLIC_ void ndr_print_drsuapi_DsReplicaAddOptions(struct ndr_print *ndr, const char *name, uint32_t r)
3690 ndr_print_uint32(ndr, name, r);
3691 ndr->depth++;
3692 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_ADD_ASYNCHRONOUS_OPERATION", DRSUAPI_DS_REPLICA_ADD_ASYNCHRONOUS_OPERATION, r);
3693 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_ADD_WRITEABLE", DRSUAPI_DS_REPLICA_ADD_WRITEABLE, r);
3694 ndr->depth--;
3697 static enum ndr_err_code ndr_push_drsuapi_DsReplicaDeleteOptions(struct ndr_push *ndr, int ndr_flags, uint32_t r)
3699 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
3700 return NDR_ERR_SUCCESS;
3703 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaDeleteOptions(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
3705 uint32_t v;
3706 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
3707 *r = v;
3708 return NDR_ERR_SUCCESS;
3711 _PUBLIC_ void ndr_print_drsuapi_DsReplicaDeleteOptions(struct ndr_print *ndr, const char *name, uint32_t r)
3713 ndr_print_uint32(ndr, name, r);
3714 ndr->depth++;
3715 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_DELETE_ASYNCHRONOUS_OPERATION", DRSUAPI_DS_REPLICA_DELETE_ASYNCHRONOUS_OPERATION, r);
3716 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_DELETE_WRITEABLE", DRSUAPI_DS_REPLICA_DELETE_WRITEABLE, r);
3717 ndr->depth--;
3720 static enum ndr_err_code ndr_push_drsuapi_DsReplicaModifyOptions(struct ndr_push *ndr, int ndr_flags, uint32_t r)
3722 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
3723 return NDR_ERR_SUCCESS;
3726 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaModifyOptions(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
3728 uint32_t v;
3729 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
3730 *r = v;
3731 return NDR_ERR_SUCCESS;
3734 _PUBLIC_ void ndr_print_drsuapi_DsReplicaModifyOptions(struct ndr_print *ndr, const char *name, uint32_t r)
3736 ndr_print_uint32(ndr, name, r);
3737 ndr->depth++;
3738 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_MODIFY_ASYNCHRONOUS_OPERATION", DRSUAPI_DS_REPLICA_MODIFY_ASYNCHRONOUS_OPERATION, r);
3739 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_MODIFY_WRITEABLE", DRSUAPI_DS_REPLICA_MODIFY_WRITEABLE, r);
3740 ndr->depth--;
3743 static enum ndr_err_code ndr_push_drsuapi_DsMembershipType(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsMembershipType r)
3745 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
3746 return NDR_ERR_SUCCESS;
3749 static enum ndr_err_code ndr_pull_drsuapi_DsMembershipType(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsMembershipType *r)
3751 uint32_t v;
3752 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
3753 *r = v;
3754 return NDR_ERR_SUCCESS;
3757 _PUBLIC_ void ndr_print_drsuapi_DsMembershipType(struct ndr_print *ndr, const char *name, enum drsuapi_DsMembershipType r)
3759 const char *val = NULL;
3761 switch (r) {
3762 case DRSUAPI_DS_MEMBERSHIP_TYPE_UNIVERSAL_AND_DOMAIN_GROUPS: val = "DRSUAPI_DS_MEMBERSHIP_TYPE_UNIVERSAL_AND_DOMAIN_GROUPS"; break;
3763 case DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_LOCAL_GROUPS: val = "DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_LOCAL_GROUPS"; break;
3764 case DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_GROUPS: val = "DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_GROUPS"; break;
3765 case DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_LOCAL_GROUPS2: val = "DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_LOCAL_GROUPS2"; break;
3766 case DRSUAPI_DS_MEMBERSHIP_TYPE_UNIVERSAL_GROUPS: val = "DRSUAPI_DS_MEMBERSHIP_TYPE_UNIVERSAL_GROUPS"; break;
3767 case DRSUAPI_DS_MEMBERSHIP_TYPE_GROUPMEMBERS: val = "DRSUAPI_DS_MEMBERSHIP_TYPE_GROUPMEMBERS"; break;
3768 case DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_GROUPS2: val = "DRSUAPI_DS_MEMBERSHIP_TYPE_DOMAIN_GROUPS2"; break;
3770 ndr_print_enum(ndr, name, "ENUM", val, r);
3773 static enum ndr_err_code ndr_push_drsuapi_DsGetMembershipsCtr1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetMembershipsCtr1 *r)
3775 uint32_t cntr_info_array_1;
3776 uint32_t cntr_group_attrs_1;
3777 uint32_t cntr_sids_1;
3778 if (ndr_flags & NDR_SCALARS) {
3779 NDR_CHECK(ndr_push_align(ndr, 4));
3780 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->status));
3781 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_memberships));
3782 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_sids));
3783 NDR_CHECK(ndr_push_unique_ptr(ndr, r->info_array));
3784 NDR_CHECK(ndr_push_unique_ptr(ndr, r->group_attrs));
3785 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sids));
3787 if (ndr_flags & NDR_BUFFERS) {
3788 if (r->info_array) {
3789 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_memberships));
3790 for (cntr_info_array_1 = 0; cntr_info_array_1 < r->num_memberships; cntr_info_array_1++) {
3791 NDR_CHECK(ndr_push_unique_ptr(ndr, r->info_array[cntr_info_array_1]));
3793 for (cntr_info_array_1 = 0; cntr_info_array_1 < r->num_memberships; cntr_info_array_1++) {
3794 if (r->info_array[cntr_info_array_1]) {
3795 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->info_array[cntr_info_array_1]));
3799 if (r->group_attrs) {
3800 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_memberships));
3801 for (cntr_group_attrs_1 = 0; cntr_group_attrs_1 < r->num_memberships; cntr_group_attrs_1++) {
3802 NDR_CHECK(ndr_push_samr_GroupAttrs(ndr, NDR_SCALARS, r->group_attrs[cntr_group_attrs_1]));
3805 if (r->sids) {
3806 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_sids));
3807 for (cntr_sids_1 = 0; cntr_sids_1 < r->num_sids; cntr_sids_1++) {
3808 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sids[cntr_sids_1]));
3810 for (cntr_sids_1 = 0; cntr_sids_1 < r->num_sids; cntr_sids_1++) {
3811 if (r->sids[cntr_sids_1]) {
3812 NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_SCALARS|NDR_BUFFERS, r->sids[cntr_sids_1]));
3817 return NDR_ERR_SUCCESS;
3820 static enum ndr_err_code ndr_pull_drsuapi_DsGetMembershipsCtr1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetMembershipsCtr1 *r)
3822 uint32_t _ptr_info_array;
3823 uint32_t cntr_info_array_1;
3824 TALLOC_CTX *_mem_save_info_array_0;
3825 TALLOC_CTX *_mem_save_info_array_1;
3826 TALLOC_CTX *_mem_save_info_array_2;
3827 uint32_t _ptr_group_attrs;
3828 uint32_t cntr_group_attrs_1;
3829 TALLOC_CTX *_mem_save_group_attrs_0;
3830 TALLOC_CTX *_mem_save_group_attrs_1;
3831 uint32_t _ptr_sids;
3832 uint32_t cntr_sids_1;
3833 TALLOC_CTX *_mem_save_sids_0;
3834 TALLOC_CTX *_mem_save_sids_1;
3835 TALLOC_CTX *_mem_save_sids_2;
3836 if (ndr_flags & NDR_SCALARS) {
3837 NDR_CHECK(ndr_pull_align(ndr, 4));
3838 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->status));
3839 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_memberships));
3840 if (r->num_memberships > 10000) {
3841 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
3843 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_sids));
3844 if (r->num_sids > 10000) {
3845 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
3847 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info_array));
3848 if (_ptr_info_array) {
3849 NDR_PULL_ALLOC(ndr, r->info_array);
3850 } else {
3851 r->info_array = NULL;
3853 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_group_attrs));
3854 if (_ptr_group_attrs) {
3855 NDR_PULL_ALLOC(ndr, r->group_attrs);
3856 } else {
3857 r->group_attrs = NULL;
3859 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sids));
3860 if (_ptr_sids) {
3861 NDR_PULL_ALLOC(ndr, r->sids);
3862 } else {
3863 r->sids = NULL;
3866 if (ndr_flags & NDR_BUFFERS) {
3867 if (r->info_array) {
3868 _mem_save_info_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
3869 NDR_PULL_SET_MEM_CTX(ndr, r->info_array, 0);
3870 NDR_CHECK(ndr_pull_array_size(ndr, &r->info_array));
3871 NDR_PULL_ALLOC_N(ndr, r->info_array, ndr_get_array_size(ndr, &r->info_array));
3872 _mem_save_info_array_1 = NDR_PULL_GET_MEM_CTX(ndr);
3873 NDR_PULL_SET_MEM_CTX(ndr, r->info_array, 0);
3874 for (cntr_info_array_1 = 0; cntr_info_array_1 < r->num_memberships; cntr_info_array_1++) {
3875 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info_array));
3876 if (_ptr_info_array) {
3877 NDR_PULL_ALLOC(ndr, r->info_array[cntr_info_array_1]);
3878 } else {
3879 r->info_array[cntr_info_array_1] = NULL;
3882 for (cntr_info_array_1 = 0; cntr_info_array_1 < r->num_memberships; cntr_info_array_1++) {
3883 if (r->info_array[cntr_info_array_1]) {
3884 _mem_save_info_array_2 = NDR_PULL_GET_MEM_CTX(ndr);
3885 NDR_PULL_SET_MEM_CTX(ndr, r->info_array[cntr_info_array_1], 0);
3886 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->info_array[cntr_info_array_1]));
3887 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_array_2, 0);
3890 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_array_1, 0);
3891 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_array_0, 0);
3893 if (r->group_attrs) {
3894 _mem_save_group_attrs_0 = NDR_PULL_GET_MEM_CTX(ndr);
3895 NDR_PULL_SET_MEM_CTX(ndr, r->group_attrs, 0);
3896 NDR_CHECK(ndr_pull_array_size(ndr, &r->group_attrs));
3897 NDR_PULL_ALLOC_N(ndr, r->group_attrs, ndr_get_array_size(ndr, &r->group_attrs));
3898 _mem_save_group_attrs_1 = NDR_PULL_GET_MEM_CTX(ndr);
3899 NDR_PULL_SET_MEM_CTX(ndr, r->group_attrs, 0);
3900 for (cntr_group_attrs_1 = 0; cntr_group_attrs_1 < r->num_memberships; cntr_group_attrs_1++) {
3901 NDR_CHECK(ndr_pull_samr_GroupAttrs(ndr, NDR_SCALARS, &r->group_attrs[cntr_group_attrs_1]));
3903 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_attrs_1, 0);
3904 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_group_attrs_0, 0);
3906 if (r->sids) {
3907 _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr);
3908 NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0);
3909 NDR_CHECK(ndr_pull_array_size(ndr, &r->sids));
3910 NDR_PULL_ALLOC_N(ndr, r->sids, ndr_get_array_size(ndr, &r->sids));
3911 _mem_save_sids_1 = NDR_PULL_GET_MEM_CTX(ndr);
3912 NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0);
3913 for (cntr_sids_1 = 0; cntr_sids_1 < r->num_sids; cntr_sids_1++) {
3914 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sids));
3915 if (_ptr_sids) {
3916 NDR_PULL_ALLOC(ndr, r->sids[cntr_sids_1]);
3917 } else {
3918 r->sids[cntr_sids_1] = NULL;
3921 for (cntr_sids_1 = 0; cntr_sids_1 < r->num_sids; cntr_sids_1++) {
3922 if (r->sids[cntr_sids_1]) {
3923 _mem_save_sids_2 = NDR_PULL_GET_MEM_CTX(ndr);
3924 NDR_PULL_SET_MEM_CTX(ndr, r->sids[cntr_sids_1], 0);
3925 NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_SCALARS|NDR_BUFFERS, r->sids[cntr_sids_1]));
3926 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_2, 0);
3929 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_1, 0);
3930 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, 0);
3932 if (r->info_array) {
3933 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->info_array, r->num_memberships));
3935 if (r->group_attrs) {
3936 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->group_attrs, r->num_memberships));
3938 if (r->sids) {
3939 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sids, r->num_sids));
3942 return NDR_ERR_SUCCESS;
3945 _PUBLIC_ void ndr_print_drsuapi_DsGetMembershipsCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetMembershipsCtr1 *r)
3947 uint32_t cntr_info_array_1;
3948 uint32_t cntr_group_attrs_1;
3949 uint32_t cntr_sids_1;
3950 ndr_print_struct(ndr, name, "drsuapi_DsGetMembershipsCtr1");
3951 ndr->depth++;
3952 ndr_print_NTSTATUS(ndr, "status", r->status);
3953 ndr_print_uint32(ndr, "num_memberships", r->num_memberships);
3954 ndr_print_uint32(ndr, "num_sids", r->num_sids);
3955 ndr_print_ptr(ndr, "info_array", r->info_array);
3956 ndr->depth++;
3957 if (r->info_array) {
3958 ndr->print(ndr, "%s: ARRAY(%d)", "info_array", (int)r->num_memberships);
3959 ndr->depth++;
3960 for (cntr_info_array_1=0;cntr_info_array_1<r->num_memberships;cntr_info_array_1++) {
3961 char *idx_1=NULL;
3962 if (asprintf(&idx_1, "[%d]", cntr_info_array_1) != -1) {
3963 ndr_print_ptr(ndr, "info_array", r->info_array[cntr_info_array_1]);
3964 ndr->depth++;
3965 if (r->info_array[cntr_info_array_1]) {
3966 ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "info_array", r->info_array[cntr_info_array_1]);
3968 ndr->depth--;
3969 free(idx_1);
3972 ndr->depth--;
3974 ndr->depth--;
3975 ndr_print_ptr(ndr, "group_attrs", r->group_attrs);
3976 ndr->depth++;
3977 if (r->group_attrs) {
3978 ndr->print(ndr, "%s: ARRAY(%d)", "group_attrs", (int)r->num_memberships);
3979 ndr->depth++;
3980 for (cntr_group_attrs_1=0;cntr_group_attrs_1<r->num_memberships;cntr_group_attrs_1++) {
3981 char *idx_1=NULL;
3982 if (asprintf(&idx_1, "[%d]", cntr_group_attrs_1) != -1) {
3983 ndr_print_samr_GroupAttrs(ndr, "group_attrs", r->group_attrs[cntr_group_attrs_1]);
3984 free(idx_1);
3987 ndr->depth--;
3989 ndr->depth--;
3990 ndr_print_ptr(ndr, "sids", r->sids);
3991 ndr->depth++;
3992 if (r->sids) {
3993 ndr->print(ndr, "%s: ARRAY(%d)", "sids", (int)r->num_sids);
3994 ndr->depth++;
3995 for (cntr_sids_1=0;cntr_sids_1<r->num_sids;cntr_sids_1++) {
3996 char *idx_1=NULL;
3997 if (asprintf(&idx_1, "[%d]", cntr_sids_1) != -1) {
3998 ndr_print_ptr(ndr, "sids", r->sids[cntr_sids_1]);
3999 ndr->depth++;
4000 if (r->sids[cntr_sids_1]) {
4001 ndr_print_dom_sid28(ndr, "sids", r->sids[cntr_sids_1]);
4003 ndr->depth--;
4004 free(idx_1);
4007 ndr->depth--;
4009 ndr->depth--;
4010 ndr->depth--;
4013 static enum ndr_err_code ndr_push_drsuapi_DsGetMembershipsCtr(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetMembershipsCtr *r)
4015 if (ndr_flags & NDR_SCALARS) {
4016 int level = ndr_push_get_switch_value(ndr, r);
4017 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
4018 switch (level) {
4019 case 1: {
4020 NDR_CHECK(ndr_push_drsuapi_DsGetMembershipsCtr1(ndr, NDR_SCALARS, &r->ctr1));
4021 break; }
4023 default:
4024 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
4027 if (ndr_flags & NDR_BUFFERS) {
4028 int level = ndr_push_get_switch_value(ndr, r);
4029 switch (level) {
4030 case 1:
4031 NDR_CHECK(ndr_push_drsuapi_DsGetMembershipsCtr1(ndr, NDR_BUFFERS, &r->ctr1));
4032 break;
4034 default:
4035 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
4038 return NDR_ERR_SUCCESS;
4041 static enum ndr_err_code ndr_pull_drsuapi_DsGetMembershipsCtr(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetMembershipsCtr *r)
4043 int level;
4044 int32_t _level;
4045 level = ndr_pull_get_switch_value(ndr, r);
4046 if (ndr_flags & NDR_SCALARS) {
4047 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
4048 if (_level != level) {
4049 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
4051 switch (level) {
4052 case 1: {
4053 NDR_CHECK(ndr_pull_drsuapi_DsGetMembershipsCtr1(ndr, NDR_SCALARS, &r->ctr1));
4054 break; }
4056 default:
4057 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
4060 if (ndr_flags & NDR_BUFFERS) {
4061 switch (level) {
4062 case 1:
4063 NDR_CHECK(ndr_pull_drsuapi_DsGetMembershipsCtr1(ndr, NDR_BUFFERS, &r->ctr1));
4064 break;
4066 default:
4067 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
4070 return NDR_ERR_SUCCESS;
4073 _PUBLIC_ void ndr_print_drsuapi_DsGetMembershipsCtr(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetMembershipsCtr *r)
4075 int level;
4076 level = ndr_print_get_switch_value(ndr, r);
4077 ndr_print_union(ndr, name, level, "drsuapi_DsGetMembershipsCtr");
4078 switch (level) {
4079 case 1:
4080 ndr_print_drsuapi_DsGetMembershipsCtr1(ndr, "ctr1", &r->ctr1);
4081 break;
4083 default:
4084 ndr_print_bad_level(ndr, name, level);
4088 static enum ndr_err_code ndr_push_drsuapi_DsGetMembershipsRequest1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetMembershipsRequest1 *r)
4090 uint32_t cntr_info_array_1;
4091 if (ndr_flags & NDR_SCALARS) {
4092 NDR_CHECK(ndr_push_align(ndr, 4));
4093 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
4094 NDR_CHECK(ndr_push_unique_ptr(ndr, r->info_array));
4095 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->flags));
4096 NDR_CHECK(ndr_push_drsuapi_DsMembershipType(ndr, NDR_SCALARS, r->type));
4097 NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain));
4099 if (ndr_flags & NDR_BUFFERS) {
4100 if (r->info_array) {
4101 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
4102 for (cntr_info_array_1 = 0; cntr_info_array_1 < r->count; cntr_info_array_1++) {
4103 NDR_CHECK(ndr_push_unique_ptr(ndr, r->info_array[cntr_info_array_1]));
4105 for (cntr_info_array_1 = 0; cntr_info_array_1 < r->count; cntr_info_array_1++) {
4106 if (r->info_array[cntr_info_array_1]) {
4107 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->info_array[cntr_info_array_1]));
4111 if (r->domain) {
4112 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->domain));
4115 return NDR_ERR_SUCCESS;
4118 static enum ndr_err_code ndr_pull_drsuapi_DsGetMembershipsRequest1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetMembershipsRequest1 *r)
4120 uint32_t _ptr_info_array;
4121 uint32_t cntr_info_array_1;
4122 TALLOC_CTX *_mem_save_info_array_0;
4123 TALLOC_CTX *_mem_save_info_array_1;
4124 TALLOC_CTX *_mem_save_info_array_2;
4125 uint32_t _ptr_domain;
4126 TALLOC_CTX *_mem_save_domain_0;
4127 if (ndr_flags & NDR_SCALARS) {
4128 NDR_CHECK(ndr_pull_align(ndr, 4));
4129 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
4130 if (r->count < 1 || r->count > 10000) {
4131 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
4133 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info_array));
4134 if (_ptr_info_array) {
4135 NDR_PULL_ALLOC(ndr, r->info_array);
4136 } else {
4137 r->info_array = NULL;
4139 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->flags));
4140 NDR_CHECK(ndr_pull_drsuapi_DsMembershipType(ndr, NDR_SCALARS, &r->type));
4141 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain));
4142 if (_ptr_domain) {
4143 NDR_PULL_ALLOC(ndr, r->domain);
4144 } else {
4145 r->domain = NULL;
4148 if (ndr_flags & NDR_BUFFERS) {
4149 if (r->info_array) {
4150 _mem_save_info_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
4151 NDR_PULL_SET_MEM_CTX(ndr, r->info_array, 0);
4152 NDR_CHECK(ndr_pull_array_size(ndr, &r->info_array));
4153 NDR_PULL_ALLOC_N(ndr, r->info_array, ndr_get_array_size(ndr, &r->info_array));
4154 _mem_save_info_array_1 = NDR_PULL_GET_MEM_CTX(ndr);
4155 NDR_PULL_SET_MEM_CTX(ndr, r->info_array, 0);
4156 for (cntr_info_array_1 = 0; cntr_info_array_1 < r->count; cntr_info_array_1++) {
4157 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info_array));
4158 if (_ptr_info_array) {
4159 NDR_PULL_ALLOC(ndr, r->info_array[cntr_info_array_1]);
4160 } else {
4161 r->info_array[cntr_info_array_1] = NULL;
4164 for (cntr_info_array_1 = 0; cntr_info_array_1 < r->count; cntr_info_array_1++) {
4165 if (r->info_array[cntr_info_array_1]) {
4166 _mem_save_info_array_2 = NDR_PULL_GET_MEM_CTX(ndr);
4167 NDR_PULL_SET_MEM_CTX(ndr, r->info_array[cntr_info_array_1], 0);
4168 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->info_array[cntr_info_array_1]));
4169 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_array_2, 0);
4172 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_array_1, 0);
4173 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_array_0, 0);
4175 if (r->domain) {
4176 _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr);
4177 NDR_PULL_SET_MEM_CTX(ndr, r->domain, 0);
4178 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->domain));
4179 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0);
4181 if (r->info_array) {
4182 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->info_array, r->count));
4185 return NDR_ERR_SUCCESS;
4188 _PUBLIC_ void ndr_print_drsuapi_DsGetMembershipsRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetMembershipsRequest1 *r)
4190 uint32_t cntr_info_array_1;
4191 ndr_print_struct(ndr, name, "drsuapi_DsGetMembershipsRequest1");
4192 ndr->depth++;
4193 ndr_print_uint32(ndr, "count", r->count);
4194 ndr_print_ptr(ndr, "info_array", r->info_array);
4195 ndr->depth++;
4196 if (r->info_array) {
4197 ndr->print(ndr, "%s: ARRAY(%d)", "info_array", (int)r->count);
4198 ndr->depth++;
4199 for (cntr_info_array_1=0;cntr_info_array_1<r->count;cntr_info_array_1++) {
4200 char *idx_1=NULL;
4201 if (asprintf(&idx_1, "[%d]", cntr_info_array_1) != -1) {
4202 ndr_print_ptr(ndr, "info_array", r->info_array[cntr_info_array_1]);
4203 ndr->depth++;
4204 if (r->info_array[cntr_info_array_1]) {
4205 ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "info_array", r->info_array[cntr_info_array_1]);
4207 ndr->depth--;
4208 free(idx_1);
4211 ndr->depth--;
4213 ndr->depth--;
4214 ndr_print_uint32(ndr, "flags", r->flags);
4215 ndr_print_drsuapi_DsMembershipType(ndr, "type", r->type);
4216 ndr_print_ptr(ndr, "domain", r->domain);
4217 ndr->depth++;
4218 if (r->domain) {
4219 ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "domain", r->domain);
4221 ndr->depth--;
4222 ndr->depth--;
4225 static enum ndr_err_code ndr_push_drsuapi_DsGetMembershipsRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetMembershipsRequest *r)
4227 if (ndr_flags & NDR_SCALARS) {
4228 int level = ndr_push_get_switch_value(ndr, r);
4229 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
4230 switch (level) {
4231 case 1: {
4232 NDR_CHECK(ndr_push_drsuapi_DsGetMembershipsRequest1(ndr, NDR_SCALARS, &r->req1));
4233 break; }
4235 default:
4236 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
4239 if (ndr_flags & NDR_BUFFERS) {
4240 int level = ndr_push_get_switch_value(ndr, r);
4241 switch (level) {
4242 case 1:
4243 NDR_CHECK(ndr_push_drsuapi_DsGetMembershipsRequest1(ndr, NDR_BUFFERS, &r->req1));
4244 break;
4246 default:
4247 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
4250 return NDR_ERR_SUCCESS;
4253 static enum ndr_err_code ndr_pull_drsuapi_DsGetMembershipsRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetMembershipsRequest *r)
4255 int level;
4256 int32_t _level;
4257 level = ndr_pull_get_switch_value(ndr, r);
4258 if (ndr_flags & NDR_SCALARS) {
4259 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
4260 if (_level != level) {
4261 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
4263 switch (level) {
4264 case 1: {
4265 NDR_CHECK(ndr_pull_drsuapi_DsGetMembershipsRequest1(ndr, NDR_SCALARS, &r->req1));
4266 break; }
4268 default:
4269 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
4272 if (ndr_flags & NDR_BUFFERS) {
4273 switch (level) {
4274 case 1:
4275 NDR_CHECK(ndr_pull_drsuapi_DsGetMembershipsRequest1(ndr, NDR_BUFFERS, &r->req1));
4276 break;
4278 default:
4279 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
4282 return NDR_ERR_SUCCESS;
4285 _PUBLIC_ void ndr_print_drsuapi_DsGetMembershipsRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetMembershipsRequest *r)
4287 int level;
4288 level = ndr_print_get_switch_value(ndr, r);
4289 ndr_print_union(ndr, name, level, "drsuapi_DsGetMembershipsRequest");
4290 switch (level) {
4291 case 1:
4292 ndr_print_drsuapi_DsGetMembershipsRequest1(ndr, "req1", &r->req1);
4293 break;
4295 default:
4296 ndr_print_bad_level(ndr, name, level);
4300 static enum ndr_err_code ndr_push_drsuapi_DsGetNT4ChangeLogRequest1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNT4ChangeLogRequest1 *r)
4302 if (ndr_flags & NDR_SCALARS) {
4303 NDR_CHECK(ndr_push_align(ndr, 4));
4304 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1));
4305 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2));
4306 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length));
4307 NDR_CHECK(ndr_push_unique_ptr(ndr, r->data));
4309 if (ndr_flags & NDR_BUFFERS) {
4310 if (r->data) {
4311 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length));
4312 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->length));
4315 return NDR_ERR_SUCCESS;
4318 static enum ndr_err_code ndr_pull_drsuapi_DsGetNT4ChangeLogRequest1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNT4ChangeLogRequest1 *r)
4320 uint32_t _ptr_data;
4321 TALLOC_CTX *_mem_save_data_0;
4322 if (ndr_flags & NDR_SCALARS) {
4323 NDR_CHECK(ndr_pull_align(ndr, 4));
4324 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1));
4325 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2));
4326 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length));
4327 if (r->length > 0x00A00000) {
4328 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
4330 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data));
4331 if (_ptr_data) {
4332 NDR_PULL_ALLOC(ndr, r->data);
4333 } else {
4334 r->data = NULL;
4337 if (ndr_flags & NDR_BUFFERS) {
4338 if (r->data) {
4339 _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
4340 NDR_PULL_SET_MEM_CTX(ndr, r->data, 0);
4341 NDR_CHECK(ndr_pull_array_size(ndr, &r->data));
4342 NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data));
4343 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, ndr_get_array_size(ndr, &r->data)));
4344 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0);
4346 if (r->data) {
4347 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->length));
4350 return NDR_ERR_SUCCESS;
4353 _PUBLIC_ void ndr_print_drsuapi_DsGetNT4ChangeLogRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNT4ChangeLogRequest1 *r)
4355 ndr_print_struct(ndr, name, "drsuapi_DsGetNT4ChangeLogRequest1");
4356 ndr->depth++;
4357 ndr_print_uint32(ndr, "unknown1", r->unknown1);
4358 ndr_print_uint32(ndr, "unknown2", r->unknown2);
4359 ndr_print_uint32(ndr, "length", r->length);
4360 ndr_print_ptr(ndr, "data", r->data);
4361 ndr->depth++;
4362 if (r->data) {
4363 ndr_print_array_uint8(ndr, "data", r->data, r->length);
4365 ndr->depth--;
4366 ndr->depth--;
4369 static enum ndr_err_code ndr_push_drsuapi_DsGetNT4ChangeLogRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetNT4ChangeLogRequest *r)
4371 if (ndr_flags & NDR_SCALARS) {
4372 int level = ndr_push_get_switch_value(ndr, r);
4373 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level));
4374 switch (level) {
4375 case 1: {
4376 NDR_CHECK(ndr_push_drsuapi_DsGetNT4ChangeLogRequest1(ndr, NDR_SCALARS, &r->req1));
4377 break; }
4379 default:
4380 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
4383 if (ndr_flags & NDR_BUFFERS) {
4384 int level = ndr_push_get_switch_value(ndr, r);
4385 switch (level) {
4386 case 1:
4387 NDR_CHECK(ndr_push_drsuapi_DsGetNT4ChangeLogRequest1(ndr, NDR_BUFFERS, &r->req1));
4388 break;
4390 default:
4391 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
4394 return NDR_ERR_SUCCESS;
4397 static enum ndr_err_code ndr_pull_drsuapi_DsGetNT4ChangeLogRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetNT4ChangeLogRequest *r)
4399 int level;
4400 uint32_t _level;
4401 level = ndr_pull_get_switch_value(ndr, r);
4402 if (ndr_flags & NDR_SCALARS) {
4403 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
4404 if (_level != level) {
4405 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
4407 switch (level) {
4408 case 1: {
4409 NDR_CHECK(ndr_pull_drsuapi_DsGetNT4ChangeLogRequest1(ndr, NDR_SCALARS, &r->req1));
4410 break; }
4412 default:
4413 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
4416 if (ndr_flags & NDR_BUFFERS) {
4417 switch (level) {
4418 case 1:
4419 NDR_CHECK(ndr_pull_drsuapi_DsGetNT4ChangeLogRequest1(ndr, NDR_BUFFERS, &r->req1));
4420 break;
4422 default:
4423 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
4426 return NDR_ERR_SUCCESS;
4429 _PUBLIC_ void ndr_print_drsuapi_DsGetNT4ChangeLogRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetNT4ChangeLogRequest *r)
4431 int level;
4432 level = ndr_print_get_switch_value(ndr, r);
4433 ndr_print_union(ndr, name, level, "drsuapi_DsGetNT4ChangeLogRequest");
4434 switch (level) {
4435 case 1:
4436 ndr_print_drsuapi_DsGetNT4ChangeLogRequest1(ndr, "req1", &r->req1);
4437 break;
4439 default:
4440 ndr_print_bad_level(ndr, name, level);
4444 static enum ndr_err_code ndr_push_drsuapi_DsGetNT4ChangeLogInfo1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNT4ChangeLogInfo1 *r)
4446 if (ndr_flags & NDR_SCALARS) {
4447 NDR_CHECK(ndr_push_align(ndr, 8));
4448 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length1));
4449 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length2));
4450 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown1));
4451 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->time2));
4452 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown3));
4453 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->time4));
4454 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown5));
4455 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->time6));
4456 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->status));
4457 NDR_CHECK(ndr_push_unique_ptr(ndr, r->data1));
4458 NDR_CHECK(ndr_push_unique_ptr(ndr, r->data2));
4460 if (ndr_flags & NDR_BUFFERS) {
4461 if (r->data1) {
4462 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length1));
4463 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data1, r->length1));
4465 if (r->data2) {
4466 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length2));
4467 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data2, r->length2));
4470 return NDR_ERR_SUCCESS;
4473 static enum ndr_err_code ndr_pull_drsuapi_DsGetNT4ChangeLogInfo1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNT4ChangeLogInfo1 *r)
4475 uint32_t _ptr_data1;
4476 TALLOC_CTX *_mem_save_data1_0;
4477 uint32_t _ptr_data2;
4478 TALLOC_CTX *_mem_save_data2_0;
4479 if (ndr_flags & NDR_SCALARS) {
4480 NDR_CHECK(ndr_pull_align(ndr, 8));
4481 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length1));
4482 if (r->length1 > 0x00A00000) {
4483 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
4485 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length2));
4486 if (r->length2 > 0x00A00000) {
4487 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
4489 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown1));
4490 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->time2));
4491 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown3));
4492 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->time4));
4493 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown5));
4494 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->time6));
4495 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->status));
4496 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data1));
4497 if (_ptr_data1) {
4498 NDR_PULL_ALLOC(ndr, r->data1);
4499 } else {
4500 r->data1 = NULL;
4502 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data2));
4503 if (_ptr_data2) {
4504 NDR_PULL_ALLOC(ndr, r->data2);
4505 } else {
4506 r->data2 = NULL;
4509 if (ndr_flags & NDR_BUFFERS) {
4510 if (r->data1) {
4511 _mem_save_data1_0 = NDR_PULL_GET_MEM_CTX(ndr);
4512 NDR_PULL_SET_MEM_CTX(ndr, r->data1, 0);
4513 NDR_CHECK(ndr_pull_array_size(ndr, &r->data1));
4514 NDR_PULL_ALLOC_N(ndr, r->data1, ndr_get_array_size(ndr, &r->data1));
4515 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data1, ndr_get_array_size(ndr, &r->data1)));
4516 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data1_0, 0);
4518 if (r->data2) {
4519 _mem_save_data2_0 = NDR_PULL_GET_MEM_CTX(ndr);
4520 NDR_PULL_SET_MEM_CTX(ndr, r->data2, 0);
4521 NDR_CHECK(ndr_pull_array_size(ndr, &r->data2));
4522 NDR_PULL_ALLOC_N(ndr, r->data2, ndr_get_array_size(ndr, &r->data2));
4523 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data2, ndr_get_array_size(ndr, &r->data2)));
4524 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data2_0, 0);
4526 if (r->data1) {
4527 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data1, r->length1));
4529 if (r->data2) {
4530 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data2, r->length2));
4533 return NDR_ERR_SUCCESS;
4536 _PUBLIC_ void ndr_print_drsuapi_DsGetNT4ChangeLogInfo1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNT4ChangeLogInfo1 *r)
4538 ndr_print_struct(ndr, name, "drsuapi_DsGetNT4ChangeLogInfo1");
4539 ndr->depth++;
4540 ndr_print_uint32(ndr, "length1", r->length1);
4541 ndr_print_uint32(ndr, "length2", r->length2);
4542 ndr_print_hyper(ndr, "unknown1", r->unknown1);
4543 ndr_print_NTTIME(ndr, "time2", r->time2);
4544 ndr_print_hyper(ndr, "unknown3", r->unknown3);
4545 ndr_print_NTTIME(ndr, "time4", r->time4);
4546 ndr_print_hyper(ndr, "unknown5", r->unknown5);
4547 ndr_print_NTTIME(ndr, "time6", r->time6);
4548 ndr_print_NTSTATUS(ndr, "status", r->status);
4549 ndr_print_ptr(ndr, "data1", r->data1);
4550 ndr->depth++;
4551 if (r->data1) {
4552 ndr_print_array_uint8(ndr, "data1", r->data1, r->length1);
4554 ndr->depth--;
4555 ndr_print_ptr(ndr, "data2", r->data2);
4556 ndr->depth++;
4557 if (r->data2) {
4558 ndr_print_array_uint8(ndr, "data2", r->data2, r->length2);
4560 ndr->depth--;
4561 ndr->depth--;
4564 static enum ndr_err_code ndr_push_drsuapi_DsGetNT4ChangeLogInfo(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetNT4ChangeLogInfo *r)
4566 if (ndr_flags & NDR_SCALARS) {
4567 int level = ndr_push_get_switch_value(ndr, r);
4568 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level));
4569 switch (level) {
4570 case 1: {
4571 NDR_CHECK(ndr_push_drsuapi_DsGetNT4ChangeLogInfo1(ndr, NDR_SCALARS, &r->info1));
4572 break; }
4574 default:
4575 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
4578 if (ndr_flags & NDR_BUFFERS) {
4579 int level = ndr_push_get_switch_value(ndr, r);
4580 switch (level) {
4581 case 1:
4582 NDR_CHECK(ndr_push_drsuapi_DsGetNT4ChangeLogInfo1(ndr, NDR_BUFFERS, &r->info1));
4583 break;
4585 default:
4586 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
4589 return NDR_ERR_SUCCESS;
4592 static enum ndr_err_code ndr_pull_drsuapi_DsGetNT4ChangeLogInfo(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetNT4ChangeLogInfo *r)
4594 int level;
4595 uint32_t _level;
4596 level = ndr_pull_get_switch_value(ndr, r);
4597 if (ndr_flags & NDR_SCALARS) {
4598 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
4599 if (_level != level) {
4600 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
4602 switch (level) {
4603 case 1: {
4604 NDR_CHECK(ndr_pull_drsuapi_DsGetNT4ChangeLogInfo1(ndr, NDR_SCALARS, &r->info1));
4605 break; }
4607 default:
4608 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
4611 if (ndr_flags & NDR_BUFFERS) {
4612 switch (level) {
4613 case 1:
4614 NDR_CHECK(ndr_pull_drsuapi_DsGetNT4ChangeLogInfo1(ndr, NDR_BUFFERS, &r->info1));
4615 break;
4617 default:
4618 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
4621 return NDR_ERR_SUCCESS;
4624 _PUBLIC_ void ndr_print_drsuapi_DsGetNT4ChangeLogInfo(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetNT4ChangeLogInfo *r)
4626 int level;
4627 level = ndr_print_get_switch_value(ndr, r);
4628 ndr_print_union(ndr, name, level, "drsuapi_DsGetNT4ChangeLogInfo");
4629 switch (level) {
4630 case 1:
4631 ndr_print_drsuapi_DsGetNT4ChangeLogInfo1(ndr, "info1", &r->info1);
4632 break;
4634 default:
4635 ndr_print_bad_level(ndr, name, level);
4639 static enum ndr_err_code ndr_push_drsuapi_DsNameStatus(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsNameStatus r)
4641 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
4642 return NDR_ERR_SUCCESS;
4645 static enum ndr_err_code ndr_pull_drsuapi_DsNameStatus(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsNameStatus *r)
4647 uint32_t v;
4648 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
4649 *r = v;
4650 return NDR_ERR_SUCCESS;
4653 _PUBLIC_ void ndr_print_drsuapi_DsNameStatus(struct ndr_print *ndr, const char *name, enum drsuapi_DsNameStatus r)
4655 const char *val = NULL;
4657 switch (r) {
4658 case DRSUAPI_DS_NAME_STATUS_OK: val = "DRSUAPI_DS_NAME_STATUS_OK"; break;
4659 case DRSUAPI_DS_NAME_STATUS_RESOLVE_ERROR: val = "DRSUAPI_DS_NAME_STATUS_RESOLVE_ERROR"; break;
4660 case DRSUAPI_DS_NAME_STATUS_NOT_FOUND: val = "DRSUAPI_DS_NAME_STATUS_NOT_FOUND"; break;
4661 case DRSUAPI_DS_NAME_STATUS_NOT_UNIQUE: val = "DRSUAPI_DS_NAME_STATUS_NOT_UNIQUE"; break;
4662 case DRSUAPI_DS_NAME_STATUS_NO_MAPPING: val = "DRSUAPI_DS_NAME_STATUS_NO_MAPPING"; break;
4663 case DRSUAPI_DS_NAME_STATUS_DOMAIN_ONLY: val = "DRSUAPI_DS_NAME_STATUS_DOMAIN_ONLY"; break;
4664 case DRSUAPI_DS_NAME_STATUS_NO_SYNTACTICAL_MAPPING: val = "DRSUAPI_DS_NAME_STATUS_NO_SYNTACTICAL_MAPPING"; break;
4665 case DRSUAPI_DS_NAME_STATUS_TRUST_REFERRAL: val = "DRSUAPI_DS_NAME_STATUS_TRUST_REFERRAL"; break;
4667 ndr_print_enum(ndr, name, "ENUM", val, r);
4670 static enum ndr_err_code ndr_push_drsuapi_DsNameFlags(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsNameFlags r)
4672 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
4673 return NDR_ERR_SUCCESS;
4676 static enum ndr_err_code ndr_pull_drsuapi_DsNameFlags(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsNameFlags *r)
4678 uint32_t v;
4679 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
4680 *r = v;
4681 return NDR_ERR_SUCCESS;
4684 _PUBLIC_ void ndr_print_drsuapi_DsNameFlags(struct ndr_print *ndr, const char *name, enum drsuapi_DsNameFlags r)
4686 const char *val = NULL;
4688 switch (r) {
4689 case DRSUAPI_DS_NAME_FLAG_NO_FLAGS: val = "DRSUAPI_DS_NAME_FLAG_NO_FLAGS"; break;
4690 case DRSUAPI_DS_NAME_FLAG_SYNTACTICAL_ONLY: val = "DRSUAPI_DS_NAME_FLAG_SYNTACTICAL_ONLY"; break;
4691 case DRSUAPI_DS_NAME_FLAG_EVAL_AT_DC: val = "DRSUAPI_DS_NAME_FLAG_EVAL_AT_DC"; break;
4692 case DRSUAPI_DS_NAME_FLAG_GCVERIFY: val = "DRSUAPI_DS_NAME_FLAG_GCVERIFY"; break;
4693 case DRSUAPI_DS_NAME_FLAG_TRUST_REFERRAL: val = "DRSUAPI_DS_NAME_FLAG_TRUST_REFERRAL"; break;
4695 ndr_print_enum(ndr, name, "ENUM", val, r);
4698 static enum ndr_err_code ndr_push_drsuapi_DsNameFormat(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsNameFormat r)
4700 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
4701 return NDR_ERR_SUCCESS;
4704 static enum ndr_err_code ndr_pull_drsuapi_DsNameFormat(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsNameFormat *r)
4706 uint32_t v;
4707 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
4708 *r = v;
4709 return NDR_ERR_SUCCESS;
4712 _PUBLIC_ void ndr_print_drsuapi_DsNameFormat(struct ndr_print *ndr, const char *name, enum drsuapi_DsNameFormat r)
4714 const char *val = NULL;
4716 switch (r) {
4717 case DRSUAPI_DS_NAME_FORMAT_UNKNOWN: val = "DRSUAPI_DS_NAME_FORMAT_UNKNOWN"; break;
4718 case DRSUAPI_DS_NAME_FORMAT_FQDN_1779: val = "DRSUAPI_DS_NAME_FORMAT_FQDN_1779"; break;
4719 case DRSUAPI_DS_NAME_FORMAT_NT4_ACCOUNT: val = "DRSUAPI_DS_NAME_FORMAT_NT4_ACCOUNT"; break;
4720 case DRSUAPI_DS_NAME_FORMAT_DISPLAY: val = "DRSUAPI_DS_NAME_FORMAT_DISPLAY"; break;
4721 case DRSUAPI_DS_NAME_FORMAT_GUID: val = "DRSUAPI_DS_NAME_FORMAT_GUID"; break;
4722 case DRSUAPI_DS_NAME_FORMAT_CANONICAL: val = "DRSUAPI_DS_NAME_FORMAT_CANONICAL"; break;
4723 case DRSUAPI_DS_NAME_FORMAT_USER_PRINCIPAL: val = "DRSUAPI_DS_NAME_FORMAT_USER_PRINCIPAL"; break;
4724 case DRSUAPI_DS_NAME_FORMAT_CANONICAL_EX: val = "DRSUAPI_DS_NAME_FORMAT_CANONICAL_EX"; break;
4725 case DRSUAPI_DS_NAME_FORMAT_SERVICE_PRINCIPAL: val = "DRSUAPI_DS_NAME_FORMAT_SERVICE_PRINCIPAL"; break;
4726 case DRSUAPI_DS_NAME_FORMAT_SID_OR_SID_HISTORY: val = "DRSUAPI_DS_NAME_FORMAT_SID_OR_SID_HISTORY"; break;
4727 case DRSUAPI_DS_NAME_FORMAT_DNS_DOMAIN: val = "DRSUAPI_DS_NAME_FORMAT_DNS_DOMAIN"; break;
4729 ndr_print_enum(ndr, name, "ENUM", val, r);
4732 static enum ndr_err_code ndr_push_drsuapi_DsNameString(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsNameString *r)
4734 if (ndr_flags & NDR_SCALARS) {
4735 NDR_CHECK(ndr_push_align(ndr, 4));
4736 NDR_CHECK(ndr_push_unique_ptr(ndr, r->str));
4738 if (ndr_flags & NDR_BUFFERS) {
4739 if (r->str) {
4740 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->str, CH_UTF16)));
4741 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
4742 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->str, CH_UTF16)));
4743 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->str, ndr_charset_length(r->str, CH_UTF16), sizeof(uint16_t), CH_UTF16));
4746 return NDR_ERR_SUCCESS;
4749 static enum ndr_err_code ndr_pull_drsuapi_DsNameString(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsNameString *r)
4751 uint32_t _ptr_str;
4752 TALLOC_CTX *_mem_save_str_0;
4753 if (ndr_flags & NDR_SCALARS) {
4754 NDR_CHECK(ndr_pull_align(ndr, 4));
4755 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_str));
4756 if (_ptr_str) {
4757 NDR_PULL_ALLOC(ndr, r->str);
4758 } else {
4759 r->str = NULL;
4762 if (ndr_flags & NDR_BUFFERS) {
4763 if (r->str) {
4764 _mem_save_str_0 = NDR_PULL_GET_MEM_CTX(ndr);
4765 NDR_PULL_SET_MEM_CTX(ndr, r->str, 0);
4766 NDR_CHECK(ndr_pull_array_size(ndr, &r->str));
4767 NDR_CHECK(ndr_pull_array_length(ndr, &r->str));
4768 if (ndr_get_array_length(ndr, &r->str) > ndr_get_array_size(ndr, &r->str)) {
4769 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));
4771 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->str), sizeof(uint16_t)));
4772 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->str, ndr_get_array_length(ndr, &r->str), sizeof(uint16_t), CH_UTF16));
4773 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_str_0, 0);
4776 return NDR_ERR_SUCCESS;
4779 _PUBLIC_ void ndr_print_drsuapi_DsNameString(struct ndr_print *ndr, const char *name, const struct drsuapi_DsNameString *r)
4781 ndr_print_struct(ndr, name, "drsuapi_DsNameString");
4782 ndr->depth++;
4783 ndr_print_ptr(ndr, "str", r->str);
4784 ndr->depth++;
4785 if (r->str) {
4786 ndr_print_string(ndr, "str", r->str);
4788 ndr->depth--;
4789 ndr->depth--;
4792 static enum ndr_err_code ndr_push_drsuapi_DsNameRequest1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsNameRequest1 *r)
4794 uint32_t cntr_names_1;
4795 if (ndr_flags & NDR_SCALARS) {
4796 NDR_CHECK(ndr_push_align(ndr, 4));
4797 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->codepage));
4798 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->language));
4799 NDR_CHECK(ndr_push_drsuapi_DsNameFlags(ndr, NDR_SCALARS, r->format_flags));
4800 NDR_CHECK(ndr_push_drsuapi_DsNameFormat(ndr, NDR_SCALARS, r->format_offered));
4801 NDR_CHECK(ndr_push_drsuapi_DsNameFormat(ndr, NDR_SCALARS, r->format_desired));
4802 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
4803 NDR_CHECK(ndr_push_unique_ptr(ndr, r->names));
4805 if (ndr_flags & NDR_BUFFERS) {
4806 if (r->names) {
4807 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
4808 for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) {
4809 NDR_CHECK(ndr_push_drsuapi_DsNameString(ndr, NDR_SCALARS, &r->names[cntr_names_1]));
4811 for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) {
4812 NDR_CHECK(ndr_push_drsuapi_DsNameString(ndr, NDR_BUFFERS, &r->names[cntr_names_1]));
4816 return NDR_ERR_SUCCESS;
4819 static enum ndr_err_code ndr_pull_drsuapi_DsNameRequest1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsNameRequest1 *r)
4821 uint32_t _ptr_names;
4822 uint32_t cntr_names_1;
4823 TALLOC_CTX *_mem_save_names_0;
4824 TALLOC_CTX *_mem_save_names_1;
4825 if (ndr_flags & NDR_SCALARS) {
4826 NDR_CHECK(ndr_pull_align(ndr, 4));
4827 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->codepage));
4828 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->language));
4829 NDR_CHECK(ndr_pull_drsuapi_DsNameFlags(ndr, NDR_SCALARS, &r->format_flags));
4830 NDR_CHECK(ndr_pull_drsuapi_DsNameFormat(ndr, NDR_SCALARS, &r->format_offered));
4831 NDR_CHECK(ndr_pull_drsuapi_DsNameFormat(ndr, NDR_SCALARS, &r->format_desired));
4832 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
4833 if (r->count < 1 || r->count > 10000) {
4834 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
4836 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_names));
4837 if (_ptr_names) {
4838 NDR_PULL_ALLOC(ndr, r->names);
4839 } else {
4840 r->names = NULL;
4843 if (ndr_flags & NDR_BUFFERS) {
4844 if (r->names) {
4845 _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr);
4846 NDR_PULL_SET_MEM_CTX(ndr, r->names, 0);
4847 NDR_CHECK(ndr_pull_array_size(ndr, &r->names));
4848 NDR_PULL_ALLOC_N(ndr, r->names, ndr_get_array_size(ndr, &r->names));
4849 _mem_save_names_1 = NDR_PULL_GET_MEM_CTX(ndr);
4850 NDR_PULL_SET_MEM_CTX(ndr, r->names, 0);
4851 for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) {
4852 NDR_CHECK(ndr_pull_drsuapi_DsNameString(ndr, NDR_SCALARS, &r->names[cntr_names_1]));
4854 for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) {
4855 NDR_CHECK(ndr_pull_drsuapi_DsNameString(ndr, NDR_BUFFERS, &r->names[cntr_names_1]));
4857 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_1, 0);
4858 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, 0);
4860 if (r->names) {
4861 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->names, r->count));
4864 return NDR_ERR_SUCCESS;
4867 _PUBLIC_ void ndr_print_drsuapi_DsNameRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsNameRequest1 *r)
4869 uint32_t cntr_names_1;
4870 ndr_print_struct(ndr, name, "drsuapi_DsNameRequest1");
4871 ndr->depth++;
4872 ndr_print_uint32(ndr, "codepage", r->codepage);
4873 ndr_print_uint32(ndr, "language", r->language);
4874 ndr_print_drsuapi_DsNameFlags(ndr, "format_flags", r->format_flags);
4875 ndr_print_drsuapi_DsNameFormat(ndr, "format_offered", r->format_offered);
4876 ndr_print_drsuapi_DsNameFormat(ndr, "format_desired", r->format_desired);
4877 ndr_print_uint32(ndr, "count", r->count);
4878 ndr_print_ptr(ndr, "names", r->names);
4879 ndr->depth++;
4880 if (r->names) {
4881 ndr->print(ndr, "%s: ARRAY(%d)", "names", (int)r->count);
4882 ndr->depth++;
4883 for (cntr_names_1=0;cntr_names_1<r->count;cntr_names_1++) {
4884 char *idx_1=NULL;
4885 if (asprintf(&idx_1, "[%d]", cntr_names_1) != -1) {
4886 ndr_print_drsuapi_DsNameString(ndr, "names", &r->names[cntr_names_1]);
4887 free(idx_1);
4890 ndr->depth--;
4892 ndr->depth--;
4893 ndr->depth--;
4896 static enum ndr_err_code ndr_push_drsuapi_DsNameRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsNameRequest *r)
4898 if (ndr_flags & NDR_SCALARS) {
4899 int level = ndr_push_get_switch_value(ndr, r);
4900 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
4901 switch (level) {
4902 case 1: {
4903 NDR_CHECK(ndr_push_drsuapi_DsNameRequest1(ndr, NDR_SCALARS, &r->req1));
4904 break; }
4906 default:
4907 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
4910 if (ndr_flags & NDR_BUFFERS) {
4911 int level = ndr_push_get_switch_value(ndr, r);
4912 switch (level) {
4913 case 1:
4914 NDR_CHECK(ndr_push_drsuapi_DsNameRequest1(ndr, NDR_BUFFERS, &r->req1));
4915 break;
4917 default:
4918 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
4921 return NDR_ERR_SUCCESS;
4924 static enum ndr_err_code ndr_pull_drsuapi_DsNameRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsNameRequest *r)
4926 int level;
4927 int32_t _level;
4928 level = ndr_pull_get_switch_value(ndr, r);
4929 if (ndr_flags & NDR_SCALARS) {
4930 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
4931 if (_level != level) {
4932 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
4934 switch (level) {
4935 case 1: {
4936 NDR_CHECK(ndr_pull_drsuapi_DsNameRequest1(ndr, NDR_SCALARS, &r->req1));
4937 break; }
4939 default:
4940 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
4943 if (ndr_flags & NDR_BUFFERS) {
4944 switch (level) {
4945 case 1:
4946 NDR_CHECK(ndr_pull_drsuapi_DsNameRequest1(ndr, NDR_BUFFERS, &r->req1));
4947 break;
4949 default:
4950 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
4953 return NDR_ERR_SUCCESS;
4956 _PUBLIC_ void ndr_print_drsuapi_DsNameRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsNameRequest *r)
4958 int level;
4959 level = ndr_print_get_switch_value(ndr, r);
4960 ndr_print_union(ndr, name, level, "drsuapi_DsNameRequest");
4961 switch (level) {
4962 case 1:
4963 ndr_print_drsuapi_DsNameRequest1(ndr, "req1", &r->req1);
4964 break;
4966 default:
4967 ndr_print_bad_level(ndr, name, level);
4971 static enum ndr_err_code ndr_push_drsuapi_DsNameInfo1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsNameInfo1 *r)
4973 if (ndr_flags & NDR_SCALARS) {
4974 NDR_CHECK(ndr_push_align(ndr, 4));
4975 NDR_CHECK(ndr_push_drsuapi_DsNameStatus(ndr, NDR_SCALARS, r->status));
4976 NDR_CHECK(ndr_push_unique_ptr(ndr, r->dns_domain_name));
4977 NDR_CHECK(ndr_push_unique_ptr(ndr, r->result_name));
4979 if (ndr_flags & NDR_BUFFERS) {
4980 if (r->dns_domain_name) {
4981 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dns_domain_name, CH_UTF16)));
4982 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
4983 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dns_domain_name, CH_UTF16)));
4984 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));
4986 if (r->result_name) {
4987 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->result_name, CH_UTF16)));
4988 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
4989 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->result_name, CH_UTF16)));
4990 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->result_name, ndr_charset_length(r->result_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
4993 return NDR_ERR_SUCCESS;
4996 static enum ndr_err_code ndr_pull_drsuapi_DsNameInfo1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsNameInfo1 *r)
4998 uint32_t _ptr_dns_domain_name;
4999 TALLOC_CTX *_mem_save_dns_domain_name_0;
5000 uint32_t _ptr_result_name;
5001 TALLOC_CTX *_mem_save_result_name_0;
5002 if (ndr_flags & NDR_SCALARS) {
5003 NDR_CHECK(ndr_pull_align(ndr, 4));
5004 NDR_CHECK(ndr_pull_drsuapi_DsNameStatus(ndr, NDR_SCALARS, &r->status));
5005 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dns_domain_name));
5006 if (_ptr_dns_domain_name) {
5007 NDR_PULL_ALLOC(ndr, r->dns_domain_name);
5008 } else {
5009 r->dns_domain_name = NULL;
5011 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_result_name));
5012 if (_ptr_result_name) {
5013 NDR_PULL_ALLOC(ndr, r->result_name);
5014 } else {
5015 r->result_name = NULL;
5018 if (ndr_flags & NDR_BUFFERS) {
5019 if (r->dns_domain_name) {
5020 _mem_save_dns_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
5021 NDR_PULL_SET_MEM_CTX(ndr, r->dns_domain_name, 0);
5022 NDR_CHECK(ndr_pull_array_size(ndr, &r->dns_domain_name));
5023 NDR_CHECK(ndr_pull_array_length(ndr, &r->dns_domain_name));
5024 if (ndr_get_array_length(ndr, &r->dns_domain_name) > ndr_get_array_size(ndr, &r->dns_domain_name)) {
5025 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));
5027 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dns_domain_name), sizeof(uint16_t)));
5028 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));
5029 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dns_domain_name_0, 0);
5031 if (r->result_name) {
5032 _mem_save_result_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
5033 NDR_PULL_SET_MEM_CTX(ndr, r->result_name, 0);
5034 NDR_CHECK(ndr_pull_array_size(ndr, &r->result_name));
5035 NDR_CHECK(ndr_pull_array_length(ndr, &r->result_name));
5036 if (ndr_get_array_length(ndr, &r->result_name) > ndr_get_array_size(ndr, &r->result_name)) {
5037 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));
5039 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->result_name), sizeof(uint16_t)));
5040 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->result_name, ndr_get_array_length(ndr, &r->result_name), sizeof(uint16_t), CH_UTF16));
5041 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_result_name_0, 0);
5044 return NDR_ERR_SUCCESS;
5047 _PUBLIC_ void ndr_print_drsuapi_DsNameInfo1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsNameInfo1 *r)
5049 ndr_print_struct(ndr, name, "drsuapi_DsNameInfo1");
5050 ndr->depth++;
5051 ndr_print_drsuapi_DsNameStatus(ndr, "status", r->status);
5052 ndr_print_ptr(ndr, "dns_domain_name", r->dns_domain_name);
5053 ndr->depth++;
5054 if (r->dns_domain_name) {
5055 ndr_print_string(ndr, "dns_domain_name", r->dns_domain_name);
5057 ndr->depth--;
5058 ndr_print_ptr(ndr, "result_name", r->result_name);
5059 ndr->depth++;
5060 if (r->result_name) {
5061 ndr_print_string(ndr, "result_name", r->result_name);
5063 ndr->depth--;
5064 ndr->depth--;
5067 static enum ndr_err_code ndr_push_drsuapi_DsNameCtr1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsNameCtr1 *r)
5069 uint32_t cntr_array_1;
5070 if (ndr_flags & NDR_SCALARS) {
5071 NDR_CHECK(ndr_push_align(ndr, 4));
5072 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
5073 NDR_CHECK(ndr_push_unique_ptr(ndr, r->array));
5075 if (ndr_flags & NDR_BUFFERS) {
5076 if (r->array) {
5077 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
5078 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
5079 NDR_CHECK(ndr_push_drsuapi_DsNameInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
5081 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
5082 NDR_CHECK(ndr_push_drsuapi_DsNameInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
5086 return NDR_ERR_SUCCESS;
5089 static enum ndr_err_code ndr_pull_drsuapi_DsNameCtr1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsNameCtr1 *r)
5091 uint32_t _ptr_array;
5092 uint32_t cntr_array_1;
5093 TALLOC_CTX *_mem_save_array_0;
5094 TALLOC_CTX *_mem_save_array_1;
5095 if (ndr_flags & NDR_SCALARS) {
5096 NDR_CHECK(ndr_pull_align(ndr, 4));
5097 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
5098 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array));
5099 if (_ptr_array) {
5100 NDR_PULL_ALLOC(ndr, r->array);
5101 } else {
5102 r->array = NULL;
5105 if (ndr_flags & NDR_BUFFERS) {
5106 if (r->array) {
5107 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
5108 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
5109 NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
5110 NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
5111 _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr);
5112 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
5113 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
5114 NDR_CHECK(ndr_pull_drsuapi_DsNameInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
5116 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
5117 NDR_CHECK(ndr_pull_drsuapi_DsNameInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
5119 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0);
5120 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
5122 if (r->array) {
5123 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
5126 return NDR_ERR_SUCCESS;
5129 _PUBLIC_ void ndr_print_drsuapi_DsNameCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsNameCtr1 *r)
5131 uint32_t cntr_array_1;
5132 ndr_print_struct(ndr, name, "drsuapi_DsNameCtr1");
5133 ndr->depth++;
5134 ndr_print_uint32(ndr, "count", r->count);
5135 ndr_print_ptr(ndr, "array", r->array);
5136 ndr->depth++;
5137 if (r->array) {
5138 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
5139 ndr->depth++;
5140 for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) {
5141 char *idx_1=NULL;
5142 if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) {
5143 ndr_print_drsuapi_DsNameInfo1(ndr, "array", &r->array[cntr_array_1]);
5144 free(idx_1);
5147 ndr->depth--;
5149 ndr->depth--;
5150 ndr->depth--;
5153 static enum ndr_err_code ndr_push_drsuapi_DsNameCtr(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsNameCtr *r)
5155 if (ndr_flags & NDR_SCALARS) {
5156 int level = ndr_push_get_switch_value(ndr, r);
5157 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
5158 switch (level) {
5159 case 1: {
5160 NDR_CHECK(ndr_push_unique_ptr(ndr, r->ctr1));
5161 break; }
5163 default:
5164 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
5167 if (ndr_flags & NDR_BUFFERS) {
5168 int level = ndr_push_get_switch_value(ndr, r);
5169 switch (level) {
5170 case 1:
5171 if (r->ctr1) {
5172 NDR_CHECK(ndr_push_drsuapi_DsNameCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1));
5174 break;
5176 default:
5177 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
5180 return NDR_ERR_SUCCESS;
5183 static enum ndr_err_code ndr_pull_drsuapi_DsNameCtr(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsNameCtr *r)
5185 int level;
5186 int32_t _level;
5187 TALLOC_CTX *_mem_save_ctr1_0;
5188 level = ndr_pull_get_switch_value(ndr, r);
5189 if (ndr_flags & NDR_SCALARS) {
5190 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
5191 if (_level != level) {
5192 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
5194 switch (level) {
5195 case 1: {
5196 uint32_t _ptr_ctr1;
5197 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ctr1));
5198 if (_ptr_ctr1) {
5199 NDR_PULL_ALLOC(ndr, r->ctr1);
5200 } else {
5201 r->ctr1 = NULL;
5203 break; }
5205 default:
5206 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
5209 if (ndr_flags & NDR_BUFFERS) {
5210 switch (level) {
5211 case 1:
5212 if (r->ctr1) {
5213 _mem_save_ctr1_0 = NDR_PULL_GET_MEM_CTX(ndr);
5214 NDR_PULL_SET_MEM_CTX(ndr, r->ctr1, 0);
5215 NDR_CHECK(ndr_pull_drsuapi_DsNameCtr1(ndr, NDR_SCALARS|NDR_BUFFERS, r->ctr1));
5216 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr1_0, 0);
5218 break;
5220 default:
5221 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
5224 return NDR_ERR_SUCCESS;
5227 _PUBLIC_ void ndr_print_drsuapi_DsNameCtr(struct ndr_print *ndr, const char *name, const union drsuapi_DsNameCtr *r)
5229 int level;
5230 level = ndr_print_get_switch_value(ndr, r);
5231 ndr_print_union(ndr, name, level, "drsuapi_DsNameCtr");
5232 switch (level) {
5233 case 1:
5234 ndr_print_ptr(ndr, "ctr1", r->ctr1);
5235 ndr->depth++;
5236 if (r->ctr1) {
5237 ndr_print_drsuapi_DsNameCtr1(ndr, "ctr1", r->ctr1);
5239 ndr->depth--;
5240 break;
5242 default:
5243 ndr_print_bad_level(ndr, name, level);
5247 static enum ndr_err_code ndr_push_drsuapi_DsSpnOperation(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsSpnOperation r)
5249 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
5250 return NDR_ERR_SUCCESS;
5253 static enum ndr_err_code ndr_pull_drsuapi_DsSpnOperation(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsSpnOperation *r)
5255 uint32_t v;
5256 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
5257 *r = v;
5258 return NDR_ERR_SUCCESS;
5261 _PUBLIC_ void ndr_print_drsuapi_DsSpnOperation(struct ndr_print *ndr, const char *name, enum drsuapi_DsSpnOperation r)
5263 const char *val = NULL;
5265 switch (r) {
5266 case DRSUAPI_DS_SPN_OPERATION_ADD: val = "DRSUAPI_DS_SPN_OPERATION_ADD"; break;
5267 case DRSUAPI_DS_SPN_OPERATION_REPLACE: val = "DRSUAPI_DS_SPN_OPERATION_REPLACE"; break;
5268 case DRSUAPI_DS_SPN_OPERATION_DELETE: val = "DRSUAPI_DS_SPN_OPERATION_DELETE"; break;
5270 ndr_print_enum(ndr, name, "ENUM", val, r);
5273 static enum ndr_err_code ndr_push_drsuapi_DsWriteAccountSpnRequest1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsWriteAccountSpnRequest1 *r)
5275 uint32_t cntr_spn_names_1;
5276 if (ndr_flags & NDR_SCALARS) {
5277 NDR_CHECK(ndr_push_align(ndr, 4));
5278 NDR_CHECK(ndr_push_drsuapi_DsSpnOperation(ndr, NDR_SCALARS, r->operation));
5279 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1));
5280 NDR_CHECK(ndr_push_unique_ptr(ndr, r->object_dn));
5281 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
5282 NDR_CHECK(ndr_push_unique_ptr(ndr, r->spn_names));
5284 if (ndr_flags & NDR_BUFFERS) {
5285 if (r->object_dn) {
5286 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->object_dn, CH_UTF16)));
5287 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
5288 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->object_dn, CH_UTF16)));
5289 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->object_dn, ndr_charset_length(r->object_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16));
5291 if (r->spn_names) {
5292 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
5293 for (cntr_spn_names_1 = 0; cntr_spn_names_1 < r->count; cntr_spn_names_1++) {
5294 NDR_CHECK(ndr_push_drsuapi_DsNameString(ndr, NDR_SCALARS, &r->spn_names[cntr_spn_names_1]));
5296 for (cntr_spn_names_1 = 0; cntr_spn_names_1 < r->count; cntr_spn_names_1++) {
5297 NDR_CHECK(ndr_push_drsuapi_DsNameString(ndr, NDR_BUFFERS, &r->spn_names[cntr_spn_names_1]));
5301 return NDR_ERR_SUCCESS;
5304 static enum ndr_err_code ndr_pull_drsuapi_DsWriteAccountSpnRequest1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsWriteAccountSpnRequest1 *r)
5306 uint32_t _ptr_object_dn;
5307 TALLOC_CTX *_mem_save_object_dn_0;
5308 uint32_t _ptr_spn_names;
5309 uint32_t cntr_spn_names_1;
5310 TALLOC_CTX *_mem_save_spn_names_0;
5311 TALLOC_CTX *_mem_save_spn_names_1;
5312 if (ndr_flags & NDR_SCALARS) {
5313 NDR_CHECK(ndr_pull_align(ndr, 4));
5314 NDR_CHECK(ndr_pull_drsuapi_DsSpnOperation(ndr, NDR_SCALARS, &r->operation));
5315 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1));
5316 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_object_dn));
5317 if (_ptr_object_dn) {
5318 NDR_PULL_ALLOC(ndr, r->object_dn);
5319 } else {
5320 r->object_dn = NULL;
5322 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
5323 if (r->count > 10000) {
5324 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
5326 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_spn_names));
5327 if (_ptr_spn_names) {
5328 NDR_PULL_ALLOC(ndr, r->spn_names);
5329 } else {
5330 r->spn_names = NULL;
5333 if (ndr_flags & NDR_BUFFERS) {
5334 if (r->object_dn) {
5335 _mem_save_object_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
5336 NDR_PULL_SET_MEM_CTX(ndr, r->object_dn, 0);
5337 NDR_CHECK(ndr_pull_array_size(ndr, &r->object_dn));
5338 NDR_CHECK(ndr_pull_array_length(ndr, &r->object_dn));
5339 if (ndr_get_array_length(ndr, &r->object_dn) > ndr_get_array_size(ndr, &r->object_dn)) {
5340 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));
5342 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->object_dn), sizeof(uint16_t)));
5343 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->object_dn, ndr_get_array_length(ndr, &r->object_dn), sizeof(uint16_t), CH_UTF16));
5344 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_object_dn_0, 0);
5346 if (r->spn_names) {
5347 _mem_save_spn_names_0 = NDR_PULL_GET_MEM_CTX(ndr);
5348 NDR_PULL_SET_MEM_CTX(ndr, r->spn_names, 0);
5349 NDR_CHECK(ndr_pull_array_size(ndr, &r->spn_names));
5350 NDR_PULL_ALLOC_N(ndr, r->spn_names, ndr_get_array_size(ndr, &r->spn_names));
5351 _mem_save_spn_names_1 = NDR_PULL_GET_MEM_CTX(ndr);
5352 NDR_PULL_SET_MEM_CTX(ndr, r->spn_names, 0);
5353 for (cntr_spn_names_1 = 0; cntr_spn_names_1 < r->count; cntr_spn_names_1++) {
5354 NDR_CHECK(ndr_pull_drsuapi_DsNameString(ndr, NDR_SCALARS, &r->spn_names[cntr_spn_names_1]));
5356 for (cntr_spn_names_1 = 0; cntr_spn_names_1 < r->count; cntr_spn_names_1++) {
5357 NDR_CHECK(ndr_pull_drsuapi_DsNameString(ndr, NDR_BUFFERS, &r->spn_names[cntr_spn_names_1]));
5359 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_spn_names_1, 0);
5360 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_spn_names_0, 0);
5362 if (r->spn_names) {
5363 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->spn_names, r->count));
5366 return NDR_ERR_SUCCESS;
5369 _PUBLIC_ void ndr_print_drsuapi_DsWriteAccountSpnRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsWriteAccountSpnRequest1 *r)
5371 uint32_t cntr_spn_names_1;
5372 ndr_print_struct(ndr, name, "drsuapi_DsWriteAccountSpnRequest1");
5373 ndr->depth++;
5374 ndr_print_drsuapi_DsSpnOperation(ndr, "operation", r->operation);
5375 ndr_print_uint32(ndr, "unknown1", r->unknown1);
5376 ndr_print_ptr(ndr, "object_dn", r->object_dn);
5377 ndr->depth++;
5378 if (r->object_dn) {
5379 ndr_print_string(ndr, "object_dn", r->object_dn);
5381 ndr->depth--;
5382 ndr_print_uint32(ndr, "count", r->count);
5383 ndr_print_ptr(ndr, "spn_names", r->spn_names);
5384 ndr->depth++;
5385 if (r->spn_names) {
5386 ndr->print(ndr, "%s: ARRAY(%d)", "spn_names", (int)r->count);
5387 ndr->depth++;
5388 for (cntr_spn_names_1=0;cntr_spn_names_1<r->count;cntr_spn_names_1++) {
5389 char *idx_1=NULL;
5390 if (asprintf(&idx_1, "[%d]", cntr_spn_names_1) != -1) {
5391 ndr_print_drsuapi_DsNameString(ndr, "spn_names", &r->spn_names[cntr_spn_names_1]);
5392 free(idx_1);
5395 ndr->depth--;
5397 ndr->depth--;
5398 ndr->depth--;
5401 static enum ndr_err_code ndr_push_drsuapi_DsWriteAccountSpnRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsWriteAccountSpnRequest *r)
5403 if (ndr_flags & NDR_SCALARS) {
5404 int level = ndr_push_get_switch_value(ndr, r);
5405 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
5406 switch (level) {
5407 case 1: {
5408 NDR_CHECK(ndr_push_drsuapi_DsWriteAccountSpnRequest1(ndr, NDR_SCALARS, &r->req1));
5409 break; }
5411 default:
5412 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
5415 if (ndr_flags & NDR_BUFFERS) {
5416 int level = ndr_push_get_switch_value(ndr, r);
5417 switch (level) {
5418 case 1:
5419 NDR_CHECK(ndr_push_drsuapi_DsWriteAccountSpnRequest1(ndr, NDR_BUFFERS, &r->req1));
5420 break;
5422 default:
5423 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
5426 return NDR_ERR_SUCCESS;
5429 static enum ndr_err_code ndr_pull_drsuapi_DsWriteAccountSpnRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsWriteAccountSpnRequest *r)
5431 int level;
5432 int32_t _level;
5433 level = ndr_pull_get_switch_value(ndr, r);
5434 if (ndr_flags & NDR_SCALARS) {
5435 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
5436 if (_level != level) {
5437 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
5439 switch (level) {
5440 case 1: {
5441 NDR_CHECK(ndr_pull_drsuapi_DsWriteAccountSpnRequest1(ndr, NDR_SCALARS, &r->req1));
5442 break; }
5444 default:
5445 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
5448 if (ndr_flags & NDR_BUFFERS) {
5449 switch (level) {
5450 case 1:
5451 NDR_CHECK(ndr_pull_drsuapi_DsWriteAccountSpnRequest1(ndr, NDR_BUFFERS, &r->req1));
5452 break;
5454 default:
5455 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
5458 return NDR_ERR_SUCCESS;
5461 _PUBLIC_ void ndr_print_drsuapi_DsWriteAccountSpnRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsWriteAccountSpnRequest *r)
5463 int level;
5464 level = ndr_print_get_switch_value(ndr, r);
5465 ndr_print_union(ndr, name, level, "drsuapi_DsWriteAccountSpnRequest");
5466 switch (level) {
5467 case 1:
5468 ndr_print_drsuapi_DsWriteAccountSpnRequest1(ndr, "req1", &r->req1);
5469 break;
5471 default:
5472 ndr_print_bad_level(ndr, name, level);
5476 static enum ndr_err_code ndr_push_drsuapi_DsWriteAccountSpnResult1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsWriteAccountSpnResult1 *r)
5478 if (ndr_flags & NDR_SCALARS) {
5479 NDR_CHECK(ndr_push_align(ndr, 4));
5480 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->status));
5482 if (ndr_flags & NDR_BUFFERS) {
5484 return NDR_ERR_SUCCESS;
5487 static enum ndr_err_code ndr_pull_drsuapi_DsWriteAccountSpnResult1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsWriteAccountSpnResult1 *r)
5489 if (ndr_flags & NDR_SCALARS) {
5490 NDR_CHECK(ndr_pull_align(ndr, 4));
5491 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->status));
5493 if (ndr_flags & NDR_BUFFERS) {
5495 return NDR_ERR_SUCCESS;
5498 _PUBLIC_ void ndr_print_drsuapi_DsWriteAccountSpnResult1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsWriteAccountSpnResult1 *r)
5500 ndr_print_struct(ndr, name, "drsuapi_DsWriteAccountSpnResult1");
5501 ndr->depth++;
5502 ndr_print_WERROR(ndr, "status", r->status);
5503 ndr->depth--;
5506 static enum ndr_err_code ndr_push_drsuapi_DsWriteAccountSpnResult(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsWriteAccountSpnResult *r)
5508 if (ndr_flags & NDR_SCALARS) {
5509 int level = ndr_push_get_switch_value(ndr, r);
5510 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
5511 switch (level) {
5512 case 1: {
5513 NDR_CHECK(ndr_push_drsuapi_DsWriteAccountSpnResult1(ndr, NDR_SCALARS, &r->res1));
5514 break; }
5516 default:
5517 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
5520 if (ndr_flags & NDR_BUFFERS) {
5521 int level = ndr_push_get_switch_value(ndr, r);
5522 switch (level) {
5523 case 1:
5524 break;
5526 default:
5527 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
5530 return NDR_ERR_SUCCESS;
5533 static enum ndr_err_code ndr_pull_drsuapi_DsWriteAccountSpnResult(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsWriteAccountSpnResult *r)
5535 int level;
5536 int32_t _level;
5537 level = ndr_pull_get_switch_value(ndr, r);
5538 if (ndr_flags & NDR_SCALARS) {
5539 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
5540 if (_level != level) {
5541 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
5543 switch (level) {
5544 case 1: {
5545 NDR_CHECK(ndr_pull_drsuapi_DsWriteAccountSpnResult1(ndr, NDR_SCALARS, &r->res1));
5546 break; }
5548 default:
5549 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
5552 if (ndr_flags & NDR_BUFFERS) {
5553 switch (level) {
5554 case 1:
5555 break;
5557 default:
5558 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
5561 return NDR_ERR_SUCCESS;
5564 _PUBLIC_ void ndr_print_drsuapi_DsWriteAccountSpnResult(struct ndr_print *ndr, const char *name, const union drsuapi_DsWriteAccountSpnResult *r)
5566 int level;
5567 level = ndr_print_get_switch_value(ndr, r);
5568 ndr_print_union(ndr, name, level, "drsuapi_DsWriteAccountSpnResult");
5569 switch (level) {
5570 case 1:
5571 ndr_print_drsuapi_DsWriteAccountSpnResult1(ndr, "res1", &r->res1);
5572 break;
5574 default:
5575 ndr_print_bad_level(ndr, name, level);
5579 static enum ndr_err_code ndr_push_drsuapi_DsRemoveDSServerRequest1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsRemoveDSServerRequest1 *r)
5581 if (ndr_flags & NDR_SCALARS) {
5582 NDR_CHECK(ndr_push_align(ndr, 4));
5583 NDR_CHECK(ndr_push_unique_ptr(ndr, r->server_dn));
5584 NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain_dn));
5585 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->commit));
5587 if (ndr_flags & NDR_BUFFERS) {
5588 if (r->server_dn) {
5589 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_dn, CH_UTF16)));
5590 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
5591 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_dn, CH_UTF16)));
5592 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->server_dn, ndr_charset_length(r->server_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16));
5594 if (r->domain_dn) {
5595 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain_dn, CH_UTF16)));
5596 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
5597 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain_dn, CH_UTF16)));
5598 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain_dn, ndr_charset_length(r->domain_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16));
5601 return NDR_ERR_SUCCESS;
5604 static enum ndr_err_code ndr_pull_drsuapi_DsRemoveDSServerRequest1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsRemoveDSServerRequest1 *r)
5606 uint32_t _ptr_server_dn;
5607 TALLOC_CTX *_mem_save_server_dn_0;
5608 uint32_t _ptr_domain_dn;
5609 TALLOC_CTX *_mem_save_domain_dn_0;
5610 if (ndr_flags & NDR_SCALARS) {
5611 NDR_CHECK(ndr_pull_align(ndr, 4));
5612 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_dn));
5613 if (_ptr_server_dn) {
5614 NDR_PULL_ALLOC(ndr, r->server_dn);
5615 } else {
5616 r->server_dn = NULL;
5618 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_dn));
5619 if (_ptr_domain_dn) {
5620 NDR_PULL_ALLOC(ndr, r->domain_dn);
5621 } else {
5622 r->domain_dn = NULL;
5624 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->commit));
5626 if (ndr_flags & NDR_BUFFERS) {
5627 if (r->server_dn) {
5628 _mem_save_server_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
5629 NDR_PULL_SET_MEM_CTX(ndr, r->server_dn, 0);
5630 NDR_CHECK(ndr_pull_array_size(ndr, &r->server_dn));
5631 NDR_CHECK(ndr_pull_array_length(ndr, &r->server_dn));
5632 if (ndr_get_array_length(ndr, &r->server_dn) > ndr_get_array_size(ndr, &r->server_dn)) {
5633 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));
5635 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->server_dn), sizeof(uint16_t)));
5636 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->server_dn, ndr_get_array_length(ndr, &r->server_dn), sizeof(uint16_t), CH_UTF16));
5637 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_dn_0, 0);
5639 if (r->domain_dn) {
5640 _mem_save_domain_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
5641 NDR_PULL_SET_MEM_CTX(ndr, r->domain_dn, 0);
5642 NDR_CHECK(ndr_pull_array_size(ndr, &r->domain_dn));
5643 NDR_CHECK(ndr_pull_array_length(ndr, &r->domain_dn));
5644 if (ndr_get_array_length(ndr, &r->domain_dn) > ndr_get_array_size(ndr, &r->domain_dn)) {
5645 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));
5647 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain_dn), sizeof(uint16_t)));
5648 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain_dn, ndr_get_array_length(ndr, &r->domain_dn), sizeof(uint16_t), CH_UTF16));
5649 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_dn_0, 0);
5652 return NDR_ERR_SUCCESS;
5655 _PUBLIC_ void ndr_print_drsuapi_DsRemoveDSServerRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsRemoveDSServerRequest1 *r)
5657 ndr_print_struct(ndr, name, "drsuapi_DsRemoveDSServerRequest1");
5658 ndr->depth++;
5659 ndr_print_ptr(ndr, "server_dn", r->server_dn);
5660 ndr->depth++;
5661 if (r->server_dn) {
5662 ndr_print_string(ndr, "server_dn", r->server_dn);
5664 ndr->depth--;
5665 ndr_print_ptr(ndr, "domain_dn", r->domain_dn);
5666 ndr->depth++;
5667 if (r->domain_dn) {
5668 ndr_print_string(ndr, "domain_dn", r->domain_dn);
5670 ndr->depth--;
5671 ndr_print_uint32(ndr, "commit", r->commit);
5672 ndr->depth--;
5675 static enum ndr_err_code ndr_push_drsuapi_DsRemoveDSServerRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsRemoveDSServerRequest *r)
5677 if (ndr_flags & NDR_SCALARS) {
5678 int level = ndr_push_get_switch_value(ndr, r);
5679 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
5680 switch (level) {
5681 case 1: {
5682 NDR_CHECK(ndr_push_drsuapi_DsRemoveDSServerRequest1(ndr, NDR_SCALARS, &r->req1));
5683 break; }
5685 default:
5686 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
5689 if (ndr_flags & NDR_BUFFERS) {
5690 int level = ndr_push_get_switch_value(ndr, r);
5691 switch (level) {
5692 case 1:
5693 NDR_CHECK(ndr_push_drsuapi_DsRemoveDSServerRequest1(ndr, NDR_BUFFERS, &r->req1));
5694 break;
5696 default:
5697 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
5700 return NDR_ERR_SUCCESS;
5703 static enum ndr_err_code ndr_pull_drsuapi_DsRemoveDSServerRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsRemoveDSServerRequest *r)
5705 int level;
5706 int32_t _level;
5707 level = ndr_pull_get_switch_value(ndr, r);
5708 if (ndr_flags & NDR_SCALARS) {
5709 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
5710 if (_level != level) {
5711 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
5713 switch (level) {
5714 case 1: {
5715 NDR_CHECK(ndr_pull_drsuapi_DsRemoveDSServerRequest1(ndr, NDR_SCALARS, &r->req1));
5716 break; }
5718 default:
5719 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
5722 if (ndr_flags & NDR_BUFFERS) {
5723 switch (level) {
5724 case 1:
5725 NDR_CHECK(ndr_pull_drsuapi_DsRemoveDSServerRequest1(ndr, NDR_BUFFERS, &r->req1));
5726 break;
5728 default:
5729 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
5732 return NDR_ERR_SUCCESS;
5735 _PUBLIC_ void ndr_print_drsuapi_DsRemoveDSServerRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsRemoveDSServerRequest *r)
5737 int level;
5738 level = ndr_print_get_switch_value(ndr, r);
5739 ndr_print_union(ndr, name, level, "drsuapi_DsRemoveDSServerRequest");
5740 switch (level) {
5741 case 1:
5742 ndr_print_drsuapi_DsRemoveDSServerRequest1(ndr, "req1", &r->req1);
5743 break;
5745 default:
5746 ndr_print_bad_level(ndr, name, level);
5750 static enum ndr_err_code ndr_push_drsuapi_DsRemoveDSServerResult1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsRemoveDSServerResult1 *r)
5752 if (ndr_flags & NDR_SCALARS) {
5753 NDR_CHECK(ndr_push_align(ndr, 4));
5754 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->last_dc_in_domain));
5756 if (ndr_flags & NDR_BUFFERS) {
5758 return NDR_ERR_SUCCESS;
5761 static enum ndr_err_code ndr_pull_drsuapi_DsRemoveDSServerResult1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsRemoveDSServerResult1 *r)
5763 if (ndr_flags & NDR_SCALARS) {
5764 NDR_CHECK(ndr_pull_align(ndr, 4));
5765 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->last_dc_in_domain));
5767 if (ndr_flags & NDR_BUFFERS) {
5769 return NDR_ERR_SUCCESS;
5772 _PUBLIC_ void ndr_print_drsuapi_DsRemoveDSServerResult1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsRemoveDSServerResult1 *r)
5774 ndr_print_struct(ndr, name, "drsuapi_DsRemoveDSServerResult1");
5775 ndr->depth++;
5776 ndr_print_uint32(ndr, "last_dc_in_domain", r->last_dc_in_domain);
5777 ndr->depth--;
5780 static enum ndr_err_code ndr_push_drsuapi_DsRemoveDSServerResult(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsRemoveDSServerResult *r)
5782 if (ndr_flags & NDR_SCALARS) {
5783 int level = ndr_push_get_switch_value(ndr, r);
5784 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
5785 switch (level) {
5786 case 1: {
5787 NDR_CHECK(ndr_push_drsuapi_DsRemoveDSServerResult1(ndr, NDR_SCALARS, &r->res1));
5788 break; }
5790 default:
5791 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
5794 if (ndr_flags & NDR_BUFFERS) {
5795 int level = ndr_push_get_switch_value(ndr, r);
5796 switch (level) {
5797 case 1:
5798 break;
5800 default:
5801 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
5804 return NDR_ERR_SUCCESS;
5807 static enum ndr_err_code ndr_pull_drsuapi_DsRemoveDSServerResult(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsRemoveDSServerResult *r)
5809 int level;
5810 int32_t _level;
5811 level = ndr_pull_get_switch_value(ndr, r);
5812 if (ndr_flags & NDR_SCALARS) {
5813 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
5814 if (_level != level) {
5815 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
5817 switch (level) {
5818 case 1: {
5819 NDR_CHECK(ndr_pull_drsuapi_DsRemoveDSServerResult1(ndr, NDR_SCALARS, &r->res1));
5820 break; }
5822 default:
5823 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
5826 if (ndr_flags & NDR_BUFFERS) {
5827 switch (level) {
5828 case 1:
5829 break;
5831 default:
5832 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
5835 return NDR_ERR_SUCCESS;
5838 _PUBLIC_ void ndr_print_drsuapi_DsRemoveDSServerResult(struct ndr_print *ndr, const char *name, const union drsuapi_DsRemoveDSServerResult *r)
5840 int level;
5841 level = ndr_print_get_switch_value(ndr, r);
5842 ndr_print_union(ndr, name, level, "drsuapi_DsRemoveDSServerResult");
5843 switch (level) {
5844 case 1:
5845 ndr_print_drsuapi_DsRemoveDSServerResult1(ndr, "res1", &r->res1);
5846 break;
5848 default:
5849 ndr_print_bad_level(ndr, name, level);
5853 static enum ndr_err_code ndr_push_drsuapi_DsGetDCInfoRequest1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetDCInfoRequest1 *r)
5855 if (ndr_flags & NDR_SCALARS) {
5856 NDR_CHECK(ndr_push_align(ndr, 4));
5857 NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain_name));
5858 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->level));
5860 if (ndr_flags & NDR_BUFFERS) {
5861 if (r->domain_name) {
5862 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain_name, CH_UTF16)));
5863 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
5864 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain_name, CH_UTF16)));
5865 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain_name, ndr_charset_length(r->domain_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
5868 return NDR_ERR_SUCCESS;
5871 static enum ndr_err_code ndr_pull_drsuapi_DsGetDCInfoRequest1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetDCInfoRequest1 *r)
5873 uint32_t _ptr_domain_name;
5874 TALLOC_CTX *_mem_save_domain_name_0;
5875 if (ndr_flags & NDR_SCALARS) {
5876 NDR_CHECK(ndr_pull_align(ndr, 4));
5877 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_name));
5878 if (_ptr_domain_name) {
5879 NDR_PULL_ALLOC(ndr, r->domain_name);
5880 } else {
5881 r->domain_name = NULL;
5883 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->level));
5885 if (ndr_flags & NDR_BUFFERS) {
5886 if (r->domain_name) {
5887 _mem_save_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
5888 NDR_PULL_SET_MEM_CTX(ndr, r->domain_name, 0);
5889 NDR_CHECK(ndr_pull_array_size(ndr, &r->domain_name));
5890 NDR_CHECK(ndr_pull_array_length(ndr, &r->domain_name));
5891 if (ndr_get_array_length(ndr, &r->domain_name) > ndr_get_array_size(ndr, &r->domain_name)) {
5892 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));
5894 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain_name), sizeof(uint16_t)));
5895 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain_name, ndr_get_array_length(ndr, &r->domain_name), sizeof(uint16_t), CH_UTF16));
5896 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_name_0, 0);
5899 return NDR_ERR_SUCCESS;
5902 _PUBLIC_ void ndr_print_drsuapi_DsGetDCInfoRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCInfoRequest1 *r)
5904 ndr_print_struct(ndr, name, "drsuapi_DsGetDCInfoRequest1");
5905 ndr->depth++;
5906 ndr_print_ptr(ndr, "domain_name", r->domain_name);
5907 ndr->depth++;
5908 if (r->domain_name) {
5909 ndr_print_string(ndr, "domain_name", r->domain_name);
5911 ndr->depth--;
5912 ndr_print_int32(ndr, "level", r->level);
5913 ndr->depth--;
5916 static enum ndr_err_code ndr_push_drsuapi_DsGetDCInfoRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetDCInfoRequest *r)
5918 if (ndr_flags & NDR_SCALARS) {
5919 int level = ndr_push_get_switch_value(ndr, r);
5920 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
5921 switch (level) {
5922 case 1: {
5923 NDR_CHECK(ndr_push_drsuapi_DsGetDCInfoRequest1(ndr, NDR_SCALARS, &r->req1));
5924 break; }
5926 default:
5927 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
5930 if (ndr_flags & NDR_BUFFERS) {
5931 int level = ndr_push_get_switch_value(ndr, r);
5932 switch (level) {
5933 case 1:
5934 NDR_CHECK(ndr_push_drsuapi_DsGetDCInfoRequest1(ndr, NDR_BUFFERS, &r->req1));
5935 break;
5937 default:
5938 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
5941 return NDR_ERR_SUCCESS;
5944 static enum ndr_err_code ndr_pull_drsuapi_DsGetDCInfoRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetDCInfoRequest *r)
5946 int level;
5947 int32_t _level;
5948 level = ndr_pull_get_switch_value(ndr, r);
5949 if (ndr_flags & NDR_SCALARS) {
5950 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
5951 if (_level != level) {
5952 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
5954 switch (level) {
5955 case 1: {
5956 NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfoRequest1(ndr, NDR_SCALARS, &r->req1));
5957 break; }
5959 default:
5960 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
5963 if (ndr_flags & NDR_BUFFERS) {
5964 switch (level) {
5965 case 1:
5966 NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfoRequest1(ndr, NDR_BUFFERS, &r->req1));
5967 break;
5969 default:
5970 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
5973 return NDR_ERR_SUCCESS;
5976 _PUBLIC_ void ndr_print_drsuapi_DsGetDCInfoRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetDCInfoRequest *r)
5978 int level;
5979 level = ndr_print_get_switch_value(ndr, r);
5980 ndr_print_union(ndr, name, level, "drsuapi_DsGetDCInfoRequest");
5981 switch (level) {
5982 case 1:
5983 ndr_print_drsuapi_DsGetDCInfoRequest1(ndr, "req1", &r->req1);
5984 break;
5986 default:
5987 ndr_print_bad_level(ndr, name, level);
5991 static enum ndr_err_code ndr_push_drsuapi_DsGetDCInfo1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetDCInfo1 *r)
5993 if (ndr_flags & NDR_SCALARS) {
5994 NDR_CHECK(ndr_push_align(ndr, 4));
5995 NDR_CHECK(ndr_push_unique_ptr(ndr, r->netbios_name));
5996 NDR_CHECK(ndr_push_unique_ptr(ndr, r->dns_name));
5997 NDR_CHECK(ndr_push_unique_ptr(ndr, r->site_name));
5998 NDR_CHECK(ndr_push_unique_ptr(ndr, r->computer_dn));
5999 NDR_CHECK(ndr_push_unique_ptr(ndr, r->server_dn));
6000 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_pdc));
6001 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_enabled));
6003 if (ndr_flags & NDR_BUFFERS) {
6004 if (r->netbios_name) {
6005 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->netbios_name, CH_UTF16)));
6006 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
6007 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->netbios_name, CH_UTF16)));
6008 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->netbios_name, ndr_charset_length(r->netbios_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
6010 if (r->dns_name) {
6011 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dns_name, CH_UTF16)));
6012 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
6013 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dns_name, CH_UTF16)));
6014 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dns_name, ndr_charset_length(r->dns_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
6016 if (r->site_name) {
6017 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->site_name, CH_UTF16)));
6018 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
6019 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->site_name, CH_UTF16)));
6020 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->site_name, ndr_charset_length(r->site_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
6022 if (r->computer_dn) {
6023 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->computer_dn, CH_UTF16)));
6024 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
6025 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->computer_dn, CH_UTF16)));
6026 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->computer_dn, ndr_charset_length(r->computer_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16));
6028 if (r->server_dn) {
6029 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_dn, CH_UTF16)));
6030 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
6031 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_dn, CH_UTF16)));
6032 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->server_dn, ndr_charset_length(r->server_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16));
6035 return NDR_ERR_SUCCESS;
6038 static enum ndr_err_code ndr_pull_drsuapi_DsGetDCInfo1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetDCInfo1 *r)
6040 uint32_t _ptr_netbios_name;
6041 TALLOC_CTX *_mem_save_netbios_name_0;
6042 uint32_t _ptr_dns_name;
6043 TALLOC_CTX *_mem_save_dns_name_0;
6044 uint32_t _ptr_site_name;
6045 TALLOC_CTX *_mem_save_site_name_0;
6046 uint32_t _ptr_computer_dn;
6047 TALLOC_CTX *_mem_save_computer_dn_0;
6048 uint32_t _ptr_server_dn;
6049 TALLOC_CTX *_mem_save_server_dn_0;
6050 if (ndr_flags & NDR_SCALARS) {
6051 NDR_CHECK(ndr_pull_align(ndr, 4));
6052 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_netbios_name));
6053 if (_ptr_netbios_name) {
6054 NDR_PULL_ALLOC(ndr, r->netbios_name);
6055 } else {
6056 r->netbios_name = NULL;
6058 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dns_name));
6059 if (_ptr_dns_name) {
6060 NDR_PULL_ALLOC(ndr, r->dns_name);
6061 } else {
6062 r->dns_name = NULL;
6064 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_name));
6065 if (_ptr_site_name) {
6066 NDR_PULL_ALLOC(ndr, r->site_name);
6067 } else {
6068 r->site_name = NULL;
6070 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer_dn));
6071 if (_ptr_computer_dn) {
6072 NDR_PULL_ALLOC(ndr, r->computer_dn);
6073 } else {
6074 r->computer_dn = NULL;
6076 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_dn));
6077 if (_ptr_server_dn) {
6078 NDR_PULL_ALLOC(ndr, r->server_dn);
6079 } else {
6080 r->server_dn = NULL;
6082 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_pdc));
6083 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_enabled));
6085 if (ndr_flags & NDR_BUFFERS) {
6086 if (r->netbios_name) {
6087 _mem_save_netbios_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
6088 NDR_PULL_SET_MEM_CTX(ndr, r->netbios_name, 0);
6089 NDR_CHECK(ndr_pull_array_size(ndr, &r->netbios_name));
6090 NDR_CHECK(ndr_pull_array_length(ndr, &r->netbios_name));
6091 if (ndr_get_array_length(ndr, &r->netbios_name) > ndr_get_array_size(ndr, &r->netbios_name)) {
6092 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));
6094 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->netbios_name), sizeof(uint16_t)));
6095 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->netbios_name, ndr_get_array_length(ndr, &r->netbios_name), sizeof(uint16_t), CH_UTF16));
6096 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_netbios_name_0, 0);
6098 if (r->dns_name) {
6099 _mem_save_dns_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
6100 NDR_PULL_SET_MEM_CTX(ndr, r->dns_name, 0);
6101 NDR_CHECK(ndr_pull_array_size(ndr, &r->dns_name));
6102 NDR_CHECK(ndr_pull_array_length(ndr, &r->dns_name));
6103 if (ndr_get_array_length(ndr, &r->dns_name) > ndr_get_array_size(ndr, &r->dns_name)) {
6104 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));
6106 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dns_name), sizeof(uint16_t)));
6107 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dns_name, ndr_get_array_length(ndr, &r->dns_name), sizeof(uint16_t), CH_UTF16));
6108 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dns_name_0, 0);
6110 if (r->site_name) {
6111 _mem_save_site_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
6112 NDR_PULL_SET_MEM_CTX(ndr, r->site_name, 0);
6113 NDR_CHECK(ndr_pull_array_size(ndr, &r->site_name));
6114 NDR_CHECK(ndr_pull_array_length(ndr, &r->site_name));
6115 if (ndr_get_array_length(ndr, &r->site_name) > ndr_get_array_size(ndr, &r->site_name)) {
6116 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));
6118 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->site_name), sizeof(uint16_t)));
6119 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->site_name, ndr_get_array_length(ndr, &r->site_name), sizeof(uint16_t), CH_UTF16));
6120 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_name_0, 0);
6122 if (r->computer_dn) {
6123 _mem_save_computer_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
6124 NDR_PULL_SET_MEM_CTX(ndr, r->computer_dn, 0);
6125 NDR_CHECK(ndr_pull_array_size(ndr, &r->computer_dn));
6126 NDR_CHECK(ndr_pull_array_length(ndr, &r->computer_dn));
6127 if (ndr_get_array_length(ndr, &r->computer_dn) > ndr_get_array_size(ndr, &r->computer_dn)) {
6128 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));
6130 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->computer_dn), sizeof(uint16_t)));
6131 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->computer_dn, ndr_get_array_length(ndr, &r->computer_dn), sizeof(uint16_t), CH_UTF16));
6132 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_dn_0, 0);
6134 if (r->server_dn) {
6135 _mem_save_server_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
6136 NDR_PULL_SET_MEM_CTX(ndr, r->server_dn, 0);
6137 NDR_CHECK(ndr_pull_array_size(ndr, &r->server_dn));
6138 NDR_CHECK(ndr_pull_array_length(ndr, &r->server_dn));
6139 if (ndr_get_array_length(ndr, &r->server_dn) > ndr_get_array_size(ndr, &r->server_dn)) {
6140 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));
6142 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->server_dn), sizeof(uint16_t)));
6143 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->server_dn, ndr_get_array_length(ndr, &r->server_dn), sizeof(uint16_t), CH_UTF16));
6144 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_dn_0, 0);
6147 return NDR_ERR_SUCCESS;
6150 _PUBLIC_ void ndr_print_drsuapi_DsGetDCInfo1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCInfo1 *r)
6152 ndr_print_struct(ndr, name, "drsuapi_DsGetDCInfo1");
6153 ndr->depth++;
6154 ndr_print_ptr(ndr, "netbios_name", r->netbios_name);
6155 ndr->depth++;
6156 if (r->netbios_name) {
6157 ndr_print_string(ndr, "netbios_name", r->netbios_name);
6159 ndr->depth--;
6160 ndr_print_ptr(ndr, "dns_name", r->dns_name);
6161 ndr->depth++;
6162 if (r->dns_name) {
6163 ndr_print_string(ndr, "dns_name", r->dns_name);
6165 ndr->depth--;
6166 ndr_print_ptr(ndr, "site_name", r->site_name);
6167 ndr->depth++;
6168 if (r->site_name) {
6169 ndr_print_string(ndr, "site_name", r->site_name);
6171 ndr->depth--;
6172 ndr_print_ptr(ndr, "computer_dn", r->computer_dn);
6173 ndr->depth++;
6174 if (r->computer_dn) {
6175 ndr_print_string(ndr, "computer_dn", r->computer_dn);
6177 ndr->depth--;
6178 ndr_print_ptr(ndr, "server_dn", r->server_dn);
6179 ndr->depth++;
6180 if (r->server_dn) {
6181 ndr_print_string(ndr, "server_dn", r->server_dn);
6183 ndr->depth--;
6184 ndr_print_uint32(ndr, "is_pdc", r->is_pdc);
6185 ndr_print_uint32(ndr, "is_enabled", r->is_enabled);
6186 ndr->depth--;
6189 static enum ndr_err_code ndr_push_drsuapi_DsGetDCInfoCtr1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetDCInfoCtr1 *r)
6191 uint32_t cntr_array_1;
6192 if (ndr_flags & NDR_SCALARS) {
6193 NDR_CHECK(ndr_push_align(ndr, 4));
6194 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
6195 NDR_CHECK(ndr_push_unique_ptr(ndr, r->array));
6197 if (ndr_flags & NDR_BUFFERS) {
6198 if (r->array) {
6199 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
6200 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
6201 NDR_CHECK(ndr_push_drsuapi_DsGetDCInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
6203 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
6204 NDR_CHECK(ndr_push_drsuapi_DsGetDCInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
6208 return NDR_ERR_SUCCESS;
6211 static enum ndr_err_code ndr_pull_drsuapi_DsGetDCInfoCtr1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetDCInfoCtr1 *r)
6213 uint32_t _ptr_array;
6214 uint32_t cntr_array_1;
6215 TALLOC_CTX *_mem_save_array_0;
6216 TALLOC_CTX *_mem_save_array_1;
6217 if (ndr_flags & NDR_SCALARS) {
6218 NDR_CHECK(ndr_pull_align(ndr, 4));
6219 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
6220 if (r->count > 10000) {
6221 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
6223 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array));
6224 if (_ptr_array) {
6225 NDR_PULL_ALLOC(ndr, r->array);
6226 } else {
6227 r->array = NULL;
6230 if (ndr_flags & NDR_BUFFERS) {
6231 if (r->array) {
6232 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
6233 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
6234 NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
6235 NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
6236 _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr);
6237 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
6238 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
6239 NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfo1(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
6241 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
6242 NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfo1(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
6244 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0);
6245 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
6247 if (r->array) {
6248 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
6251 return NDR_ERR_SUCCESS;
6254 _PUBLIC_ void ndr_print_drsuapi_DsGetDCInfoCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCInfoCtr1 *r)
6256 uint32_t cntr_array_1;
6257 ndr_print_struct(ndr, name, "drsuapi_DsGetDCInfoCtr1");
6258 ndr->depth++;
6259 ndr_print_uint32(ndr, "count", r->count);
6260 ndr_print_ptr(ndr, "array", r->array);
6261 ndr->depth++;
6262 if (r->array) {
6263 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
6264 ndr->depth++;
6265 for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) {
6266 char *idx_1=NULL;
6267 if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) {
6268 ndr_print_drsuapi_DsGetDCInfo1(ndr, "array", &r->array[cntr_array_1]);
6269 free(idx_1);
6272 ndr->depth--;
6274 ndr->depth--;
6275 ndr->depth--;
6278 static enum ndr_err_code ndr_push_drsuapi_DsGetDCInfo2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetDCInfo2 *r)
6280 if (ndr_flags & NDR_SCALARS) {
6281 NDR_CHECK(ndr_push_align(ndr, 4));
6282 NDR_CHECK(ndr_push_unique_ptr(ndr, r->netbios_name));
6283 NDR_CHECK(ndr_push_unique_ptr(ndr, r->dns_name));
6284 NDR_CHECK(ndr_push_unique_ptr(ndr, r->site_name));
6285 NDR_CHECK(ndr_push_unique_ptr(ndr, r->site_dn));
6286 NDR_CHECK(ndr_push_unique_ptr(ndr, r->computer_dn));
6287 NDR_CHECK(ndr_push_unique_ptr(ndr, r->server_dn));
6288 NDR_CHECK(ndr_push_unique_ptr(ndr, r->ntds_dn));
6289 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_pdc));
6290 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_enabled));
6291 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_gc));
6292 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->site_guid));
6293 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->computer_guid));
6294 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->server_guid));
6295 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->ntds_guid));
6297 if (ndr_flags & NDR_BUFFERS) {
6298 if (r->netbios_name) {
6299 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->netbios_name, CH_UTF16)));
6300 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
6301 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->netbios_name, CH_UTF16)));
6302 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->netbios_name, ndr_charset_length(r->netbios_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
6304 if (r->dns_name) {
6305 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dns_name, CH_UTF16)));
6306 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
6307 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dns_name, CH_UTF16)));
6308 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dns_name, ndr_charset_length(r->dns_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
6310 if (r->site_name) {
6311 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->site_name, CH_UTF16)));
6312 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
6313 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->site_name, CH_UTF16)));
6314 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->site_name, ndr_charset_length(r->site_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
6316 if (r->site_dn) {
6317 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->site_dn, CH_UTF16)));
6318 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
6319 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->site_dn, CH_UTF16)));
6320 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->site_dn, ndr_charset_length(r->site_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16));
6322 if (r->computer_dn) {
6323 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->computer_dn, CH_UTF16)));
6324 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
6325 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->computer_dn, CH_UTF16)));
6326 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->computer_dn, ndr_charset_length(r->computer_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16));
6328 if (r->server_dn) {
6329 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_dn, CH_UTF16)));
6330 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
6331 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_dn, CH_UTF16)));
6332 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->server_dn, ndr_charset_length(r->server_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16));
6334 if (r->ntds_dn) {
6335 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->ntds_dn, CH_UTF16)));
6336 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
6337 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->ntds_dn, CH_UTF16)));
6338 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->ntds_dn, ndr_charset_length(r->ntds_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16));
6341 return NDR_ERR_SUCCESS;
6344 static enum ndr_err_code ndr_pull_drsuapi_DsGetDCInfo2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetDCInfo2 *r)
6346 uint32_t _ptr_netbios_name;
6347 TALLOC_CTX *_mem_save_netbios_name_0;
6348 uint32_t _ptr_dns_name;
6349 TALLOC_CTX *_mem_save_dns_name_0;
6350 uint32_t _ptr_site_name;
6351 TALLOC_CTX *_mem_save_site_name_0;
6352 uint32_t _ptr_site_dn;
6353 TALLOC_CTX *_mem_save_site_dn_0;
6354 uint32_t _ptr_computer_dn;
6355 TALLOC_CTX *_mem_save_computer_dn_0;
6356 uint32_t _ptr_server_dn;
6357 TALLOC_CTX *_mem_save_server_dn_0;
6358 uint32_t _ptr_ntds_dn;
6359 TALLOC_CTX *_mem_save_ntds_dn_0;
6360 if (ndr_flags & NDR_SCALARS) {
6361 NDR_CHECK(ndr_pull_align(ndr, 4));
6362 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_netbios_name));
6363 if (_ptr_netbios_name) {
6364 NDR_PULL_ALLOC(ndr, r->netbios_name);
6365 } else {
6366 r->netbios_name = NULL;
6368 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dns_name));
6369 if (_ptr_dns_name) {
6370 NDR_PULL_ALLOC(ndr, r->dns_name);
6371 } else {
6372 r->dns_name = NULL;
6374 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_name));
6375 if (_ptr_site_name) {
6376 NDR_PULL_ALLOC(ndr, r->site_name);
6377 } else {
6378 r->site_name = NULL;
6380 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_dn));
6381 if (_ptr_site_dn) {
6382 NDR_PULL_ALLOC(ndr, r->site_dn);
6383 } else {
6384 r->site_dn = NULL;
6386 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer_dn));
6387 if (_ptr_computer_dn) {
6388 NDR_PULL_ALLOC(ndr, r->computer_dn);
6389 } else {
6390 r->computer_dn = NULL;
6392 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_dn));
6393 if (_ptr_server_dn) {
6394 NDR_PULL_ALLOC(ndr, r->server_dn);
6395 } else {
6396 r->server_dn = NULL;
6398 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ntds_dn));
6399 if (_ptr_ntds_dn) {
6400 NDR_PULL_ALLOC(ndr, r->ntds_dn);
6401 } else {
6402 r->ntds_dn = NULL;
6404 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_pdc));
6405 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_enabled));
6406 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_gc));
6407 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->site_guid));
6408 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->computer_guid));
6409 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->server_guid));
6410 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->ntds_guid));
6412 if (ndr_flags & NDR_BUFFERS) {
6413 if (r->netbios_name) {
6414 _mem_save_netbios_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
6415 NDR_PULL_SET_MEM_CTX(ndr, r->netbios_name, 0);
6416 NDR_CHECK(ndr_pull_array_size(ndr, &r->netbios_name));
6417 NDR_CHECK(ndr_pull_array_length(ndr, &r->netbios_name));
6418 if (ndr_get_array_length(ndr, &r->netbios_name) > ndr_get_array_size(ndr, &r->netbios_name)) {
6419 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));
6421 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->netbios_name), sizeof(uint16_t)));
6422 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->netbios_name, ndr_get_array_length(ndr, &r->netbios_name), sizeof(uint16_t), CH_UTF16));
6423 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_netbios_name_0, 0);
6425 if (r->dns_name) {
6426 _mem_save_dns_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
6427 NDR_PULL_SET_MEM_CTX(ndr, r->dns_name, 0);
6428 NDR_CHECK(ndr_pull_array_size(ndr, &r->dns_name));
6429 NDR_CHECK(ndr_pull_array_length(ndr, &r->dns_name));
6430 if (ndr_get_array_length(ndr, &r->dns_name) > ndr_get_array_size(ndr, &r->dns_name)) {
6431 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));
6433 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dns_name), sizeof(uint16_t)));
6434 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dns_name, ndr_get_array_length(ndr, &r->dns_name), sizeof(uint16_t), CH_UTF16));
6435 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dns_name_0, 0);
6437 if (r->site_name) {
6438 _mem_save_site_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
6439 NDR_PULL_SET_MEM_CTX(ndr, r->site_name, 0);
6440 NDR_CHECK(ndr_pull_array_size(ndr, &r->site_name));
6441 NDR_CHECK(ndr_pull_array_length(ndr, &r->site_name));
6442 if (ndr_get_array_length(ndr, &r->site_name) > ndr_get_array_size(ndr, &r->site_name)) {
6443 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));
6445 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->site_name), sizeof(uint16_t)));
6446 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->site_name, ndr_get_array_length(ndr, &r->site_name), sizeof(uint16_t), CH_UTF16));
6447 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_name_0, 0);
6449 if (r->site_dn) {
6450 _mem_save_site_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
6451 NDR_PULL_SET_MEM_CTX(ndr, r->site_dn, 0);
6452 NDR_CHECK(ndr_pull_array_size(ndr, &r->site_dn));
6453 NDR_CHECK(ndr_pull_array_length(ndr, &r->site_dn));
6454 if (ndr_get_array_length(ndr, &r->site_dn) > ndr_get_array_size(ndr, &r->site_dn)) {
6455 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));
6457 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->site_dn), sizeof(uint16_t)));
6458 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->site_dn, ndr_get_array_length(ndr, &r->site_dn), sizeof(uint16_t), CH_UTF16));
6459 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_dn_0, 0);
6461 if (r->computer_dn) {
6462 _mem_save_computer_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
6463 NDR_PULL_SET_MEM_CTX(ndr, r->computer_dn, 0);
6464 NDR_CHECK(ndr_pull_array_size(ndr, &r->computer_dn));
6465 NDR_CHECK(ndr_pull_array_length(ndr, &r->computer_dn));
6466 if (ndr_get_array_length(ndr, &r->computer_dn) > ndr_get_array_size(ndr, &r->computer_dn)) {
6467 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));
6469 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->computer_dn), sizeof(uint16_t)));
6470 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->computer_dn, ndr_get_array_length(ndr, &r->computer_dn), sizeof(uint16_t), CH_UTF16));
6471 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_dn_0, 0);
6473 if (r->server_dn) {
6474 _mem_save_server_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
6475 NDR_PULL_SET_MEM_CTX(ndr, r->server_dn, 0);
6476 NDR_CHECK(ndr_pull_array_size(ndr, &r->server_dn));
6477 NDR_CHECK(ndr_pull_array_length(ndr, &r->server_dn));
6478 if (ndr_get_array_length(ndr, &r->server_dn) > ndr_get_array_size(ndr, &r->server_dn)) {
6479 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));
6481 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->server_dn), sizeof(uint16_t)));
6482 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->server_dn, ndr_get_array_length(ndr, &r->server_dn), sizeof(uint16_t), CH_UTF16));
6483 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_dn_0, 0);
6485 if (r->ntds_dn) {
6486 _mem_save_ntds_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
6487 NDR_PULL_SET_MEM_CTX(ndr, r->ntds_dn, 0);
6488 NDR_CHECK(ndr_pull_array_size(ndr, &r->ntds_dn));
6489 NDR_CHECK(ndr_pull_array_length(ndr, &r->ntds_dn));
6490 if (ndr_get_array_length(ndr, &r->ntds_dn) > ndr_get_array_size(ndr, &r->ntds_dn)) {
6491 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));
6493 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->ntds_dn), sizeof(uint16_t)));
6494 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->ntds_dn, ndr_get_array_length(ndr, &r->ntds_dn), sizeof(uint16_t), CH_UTF16));
6495 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ntds_dn_0, 0);
6498 return NDR_ERR_SUCCESS;
6501 _PUBLIC_ void ndr_print_drsuapi_DsGetDCInfo2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCInfo2 *r)
6503 ndr_print_struct(ndr, name, "drsuapi_DsGetDCInfo2");
6504 ndr->depth++;
6505 ndr_print_ptr(ndr, "netbios_name", r->netbios_name);
6506 ndr->depth++;
6507 if (r->netbios_name) {
6508 ndr_print_string(ndr, "netbios_name", r->netbios_name);
6510 ndr->depth--;
6511 ndr_print_ptr(ndr, "dns_name", r->dns_name);
6512 ndr->depth++;
6513 if (r->dns_name) {
6514 ndr_print_string(ndr, "dns_name", r->dns_name);
6516 ndr->depth--;
6517 ndr_print_ptr(ndr, "site_name", r->site_name);
6518 ndr->depth++;
6519 if (r->site_name) {
6520 ndr_print_string(ndr, "site_name", r->site_name);
6522 ndr->depth--;
6523 ndr_print_ptr(ndr, "site_dn", r->site_dn);
6524 ndr->depth++;
6525 if (r->site_dn) {
6526 ndr_print_string(ndr, "site_dn", r->site_dn);
6528 ndr->depth--;
6529 ndr_print_ptr(ndr, "computer_dn", r->computer_dn);
6530 ndr->depth++;
6531 if (r->computer_dn) {
6532 ndr_print_string(ndr, "computer_dn", r->computer_dn);
6534 ndr->depth--;
6535 ndr_print_ptr(ndr, "server_dn", r->server_dn);
6536 ndr->depth++;
6537 if (r->server_dn) {
6538 ndr_print_string(ndr, "server_dn", r->server_dn);
6540 ndr->depth--;
6541 ndr_print_ptr(ndr, "ntds_dn", r->ntds_dn);
6542 ndr->depth++;
6543 if (r->ntds_dn) {
6544 ndr_print_string(ndr, "ntds_dn", r->ntds_dn);
6546 ndr->depth--;
6547 ndr_print_uint32(ndr, "is_pdc", r->is_pdc);
6548 ndr_print_uint32(ndr, "is_enabled", r->is_enabled);
6549 ndr_print_uint32(ndr, "is_gc", r->is_gc);
6550 ndr_print_GUID(ndr, "site_guid", &r->site_guid);
6551 ndr_print_GUID(ndr, "computer_guid", &r->computer_guid);
6552 ndr_print_GUID(ndr, "server_guid", &r->server_guid);
6553 ndr_print_GUID(ndr, "ntds_guid", &r->ntds_guid);
6554 ndr->depth--;
6557 static enum ndr_err_code ndr_push_drsuapi_DsGetDCInfoCtr2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetDCInfoCtr2 *r)
6559 uint32_t cntr_array_1;
6560 if (ndr_flags & NDR_SCALARS) {
6561 NDR_CHECK(ndr_push_align(ndr, 4));
6562 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
6563 NDR_CHECK(ndr_push_unique_ptr(ndr, r->array));
6565 if (ndr_flags & NDR_BUFFERS) {
6566 if (r->array) {
6567 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
6568 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
6569 NDR_CHECK(ndr_push_drsuapi_DsGetDCInfo2(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
6571 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
6572 NDR_CHECK(ndr_push_drsuapi_DsGetDCInfo2(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
6576 return NDR_ERR_SUCCESS;
6579 static enum ndr_err_code ndr_pull_drsuapi_DsGetDCInfoCtr2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetDCInfoCtr2 *r)
6581 uint32_t _ptr_array;
6582 uint32_t cntr_array_1;
6583 TALLOC_CTX *_mem_save_array_0;
6584 TALLOC_CTX *_mem_save_array_1;
6585 if (ndr_flags & NDR_SCALARS) {
6586 NDR_CHECK(ndr_pull_align(ndr, 4));
6587 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
6588 if (r->count > 10000) {
6589 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
6591 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array));
6592 if (_ptr_array) {
6593 NDR_PULL_ALLOC(ndr, r->array);
6594 } else {
6595 r->array = NULL;
6598 if (ndr_flags & NDR_BUFFERS) {
6599 if (r->array) {
6600 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
6601 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
6602 NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
6603 NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
6604 _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr);
6605 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
6606 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
6607 NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfo2(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
6609 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
6610 NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfo2(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
6612 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0);
6613 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
6615 if (r->array) {
6616 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
6619 return NDR_ERR_SUCCESS;
6622 _PUBLIC_ void ndr_print_drsuapi_DsGetDCInfoCtr2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCInfoCtr2 *r)
6624 uint32_t cntr_array_1;
6625 ndr_print_struct(ndr, name, "drsuapi_DsGetDCInfoCtr2");
6626 ndr->depth++;
6627 ndr_print_uint32(ndr, "count", r->count);
6628 ndr_print_ptr(ndr, "array", r->array);
6629 ndr->depth++;
6630 if (r->array) {
6631 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
6632 ndr->depth++;
6633 for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) {
6634 char *idx_1=NULL;
6635 if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) {
6636 ndr_print_drsuapi_DsGetDCInfo2(ndr, "array", &r->array[cntr_array_1]);
6637 free(idx_1);
6640 ndr->depth--;
6642 ndr->depth--;
6643 ndr->depth--;
6646 static enum ndr_err_code ndr_push_drsuapi_DsGetDCInfo3(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetDCInfo3 *r)
6648 if (ndr_flags & NDR_SCALARS) {
6649 NDR_CHECK(ndr_push_align(ndr, 4));
6650 NDR_CHECK(ndr_push_unique_ptr(ndr, r->netbios_name));
6651 NDR_CHECK(ndr_push_unique_ptr(ndr, r->dns_name));
6652 NDR_CHECK(ndr_push_unique_ptr(ndr, r->site_name));
6653 NDR_CHECK(ndr_push_unique_ptr(ndr, r->site_dn));
6654 NDR_CHECK(ndr_push_unique_ptr(ndr, r->computer_dn));
6655 NDR_CHECK(ndr_push_unique_ptr(ndr, r->server_dn));
6656 NDR_CHECK(ndr_push_unique_ptr(ndr, r->ntds_dn));
6657 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_pdc));
6658 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_enabled));
6659 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_gc));
6660 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_rodc));
6661 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->site_guid));
6662 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->computer_guid));
6663 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->server_guid));
6664 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->ntds_guid));
6666 if (ndr_flags & NDR_BUFFERS) {
6667 if (r->netbios_name) {
6668 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->netbios_name, CH_UTF16)));
6669 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
6670 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->netbios_name, CH_UTF16)));
6671 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->netbios_name, ndr_charset_length(r->netbios_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
6673 if (r->dns_name) {
6674 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dns_name, CH_UTF16)));
6675 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
6676 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dns_name, CH_UTF16)));
6677 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dns_name, ndr_charset_length(r->dns_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
6679 if (r->site_name) {
6680 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->site_name, CH_UTF16)));
6681 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
6682 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->site_name, CH_UTF16)));
6683 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->site_name, ndr_charset_length(r->site_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
6685 if (r->site_dn) {
6686 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->site_dn, CH_UTF16)));
6687 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
6688 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->site_dn, CH_UTF16)));
6689 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->site_dn, ndr_charset_length(r->site_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16));
6691 if (r->computer_dn) {
6692 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->computer_dn, CH_UTF16)));
6693 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
6694 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->computer_dn, CH_UTF16)));
6695 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->computer_dn, ndr_charset_length(r->computer_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16));
6697 if (r->server_dn) {
6698 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_dn, CH_UTF16)));
6699 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
6700 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_dn, CH_UTF16)));
6701 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->server_dn, ndr_charset_length(r->server_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16));
6703 if (r->ntds_dn) {
6704 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->ntds_dn, CH_UTF16)));
6705 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
6706 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->ntds_dn, CH_UTF16)));
6707 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->ntds_dn, ndr_charset_length(r->ntds_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16));
6710 return NDR_ERR_SUCCESS;
6713 static enum ndr_err_code ndr_pull_drsuapi_DsGetDCInfo3(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetDCInfo3 *r)
6715 uint32_t _ptr_netbios_name;
6716 TALLOC_CTX *_mem_save_netbios_name_0;
6717 uint32_t _ptr_dns_name;
6718 TALLOC_CTX *_mem_save_dns_name_0;
6719 uint32_t _ptr_site_name;
6720 TALLOC_CTX *_mem_save_site_name_0;
6721 uint32_t _ptr_site_dn;
6722 TALLOC_CTX *_mem_save_site_dn_0;
6723 uint32_t _ptr_computer_dn;
6724 TALLOC_CTX *_mem_save_computer_dn_0;
6725 uint32_t _ptr_server_dn;
6726 TALLOC_CTX *_mem_save_server_dn_0;
6727 uint32_t _ptr_ntds_dn;
6728 TALLOC_CTX *_mem_save_ntds_dn_0;
6729 if (ndr_flags & NDR_SCALARS) {
6730 NDR_CHECK(ndr_pull_align(ndr, 4));
6731 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_netbios_name));
6732 if (_ptr_netbios_name) {
6733 NDR_PULL_ALLOC(ndr, r->netbios_name);
6734 } else {
6735 r->netbios_name = NULL;
6737 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dns_name));
6738 if (_ptr_dns_name) {
6739 NDR_PULL_ALLOC(ndr, r->dns_name);
6740 } else {
6741 r->dns_name = NULL;
6743 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_name));
6744 if (_ptr_site_name) {
6745 NDR_PULL_ALLOC(ndr, r->site_name);
6746 } else {
6747 r->site_name = NULL;
6749 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_dn));
6750 if (_ptr_site_dn) {
6751 NDR_PULL_ALLOC(ndr, r->site_dn);
6752 } else {
6753 r->site_dn = NULL;
6755 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer_dn));
6756 if (_ptr_computer_dn) {
6757 NDR_PULL_ALLOC(ndr, r->computer_dn);
6758 } else {
6759 r->computer_dn = NULL;
6761 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_dn));
6762 if (_ptr_server_dn) {
6763 NDR_PULL_ALLOC(ndr, r->server_dn);
6764 } else {
6765 r->server_dn = NULL;
6767 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ntds_dn));
6768 if (_ptr_ntds_dn) {
6769 NDR_PULL_ALLOC(ndr, r->ntds_dn);
6770 } else {
6771 r->ntds_dn = NULL;
6773 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_pdc));
6774 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_enabled));
6775 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_gc));
6776 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_rodc));
6777 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->site_guid));
6778 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->computer_guid));
6779 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->server_guid));
6780 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->ntds_guid));
6782 if (ndr_flags & NDR_BUFFERS) {
6783 if (r->netbios_name) {
6784 _mem_save_netbios_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
6785 NDR_PULL_SET_MEM_CTX(ndr, r->netbios_name, 0);
6786 NDR_CHECK(ndr_pull_array_size(ndr, &r->netbios_name));
6787 NDR_CHECK(ndr_pull_array_length(ndr, &r->netbios_name));
6788 if (ndr_get_array_length(ndr, &r->netbios_name) > ndr_get_array_size(ndr, &r->netbios_name)) {
6789 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));
6791 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->netbios_name), sizeof(uint16_t)));
6792 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->netbios_name, ndr_get_array_length(ndr, &r->netbios_name), sizeof(uint16_t), CH_UTF16));
6793 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_netbios_name_0, 0);
6795 if (r->dns_name) {
6796 _mem_save_dns_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
6797 NDR_PULL_SET_MEM_CTX(ndr, r->dns_name, 0);
6798 NDR_CHECK(ndr_pull_array_size(ndr, &r->dns_name));
6799 NDR_CHECK(ndr_pull_array_length(ndr, &r->dns_name));
6800 if (ndr_get_array_length(ndr, &r->dns_name) > ndr_get_array_size(ndr, &r->dns_name)) {
6801 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));
6803 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dns_name), sizeof(uint16_t)));
6804 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dns_name, ndr_get_array_length(ndr, &r->dns_name), sizeof(uint16_t), CH_UTF16));
6805 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dns_name_0, 0);
6807 if (r->site_name) {
6808 _mem_save_site_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
6809 NDR_PULL_SET_MEM_CTX(ndr, r->site_name, 0);
6810 NDR_CHECK(ndr_pull_array_size(ndr, &r->site_name));
6811 NDR_CHECK(ndr_pull_array_length(ndr, &r->site_name));
6812 if (ndr_get_array_length(ndr, &r->site_name) > ndr_get_array_size(ndr, &r->site_name)) {
6813 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));
6815 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->site_name), sizeof(uint16_t)));
6816 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->site_name, ndr_get_array_length(ndr, &r->site_name), sizeof(uint16_t), CH_UTF16));
6817 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_name_0, 0);
6819 if (r->site_dn) {
6820 _mem_save_site_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
6821 NDR_PULL_SET_MEM_CTX(ndr, r->site_dn, 0);
6822 NDR_CHECK(ndr_pull_array_size(ndr, &r->site_dn));
6823 NDR_CHECK(ndr_pull_array_length(ndr, &r->site_dn));
6824 if (ndr_get_array_length(ndr, &r->site_dn) > ndr_get_array_size(ndr, &r->site_dn)) {
6825 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));
6827 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->site_dn), sizeof(uint16_t)));
6828 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->site_dn, ndr_get_array_length(ndr, &r->site_dn), sizeof(uint16_t), CH_UTF16));
6829 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_dn_0, 0);
6831 if (r->computer_dn) {
6832 _mem_save_computer_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
6833 NDR_PULL_SET_MEM_CTX(ndr, r->computer_dn, 0);
6834 NDR_CHECK(ndr_pull_array_size(ndr, &r->computer_dn));
6835 NDR_CHECK(ndr_pull_array_length(ndr, &r->computer_dn));
6836 if (ndr_get_array_length(ndr, &r->computer_dn) > ndr_get_array_size(ndr, &r->computer_dn)) {
6837 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));
6839 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->computer_dn), sizeof(uint16_t)));
6840 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->computer_dn, ndr_get_array_length(ndr, &r->computer_dn), sizeof(uint16_t), CH_UTF16));
6841 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_dn_0, 0);
6843 if (r->server_dn) {
6844 _mem_save_server_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
6845 NDR_PULL_SET_MEM_CTX(ndr, r->server_dn, 0);
6846 NDR_CHECK(ndr_pull_array_size(ndr, &r->server_dn));
6847 NDR_CHECK(ndr_pull_array_length(ndr, &r->server_dn));
6848 if (ndr_get_array_length(ndr, &r->server_dn) > ndr_get_array_size(ndr, &r->server_dn)) {
6849 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));
6851 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->server_dn), sizeof(uint16_t)));
6852 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->server_dn, ndr_get_array_length(ndr, &r->server_dn), sizeof(uint16_t), CH_UTF16));
6853 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_dn_0, 0);
6855 if (r->ntds_dn) {
6856 _mem_save_ntds_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
6857 NDR_PULL_SET_MEM_CTX(ndr, r->ntds_dn, 0);
6858 NDR_CHECK(ndr_pull_array_size(ndr, &r->ntds_dn));
6859 NDR_CHECK(ndr_pull_array_length(ndr, &r->ntds_dn));
6860 if (ndr_get_array_length(ndr, &r->ntds_dn) > ndr_get_array_size(ndr, &r->ntds_dn)) {
6861 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));
6863 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->ntds_dn), sizeof(uint16_t)));
6864 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->ntds_dn, ndr_get_array_length(ndr, &r->ntds_dn), sizeof(uint16_t), CH_UTF16));
6865 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ntds_dn_0, 0);
6868 return NDR_ERR_SUCCESS;
6871 _PUBLIC_ void ndr_print_drsuapi_DsGetDCInfo3(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCInfo3 *r)
6873 ndr_print_struct(ndr, name, "drsuapi_DsGetDCInfo3");
6874 ndr->depth++;
6875 ndr_print_ptr(ndr, "netbios_name", r->netbios_name);
6876 ndr->depth++;
6877 if (r->netbios_name) {
6878 ndr_print_string(ndr, "netbios_name", r->netbios_name);
6880 ndr->depth--;
6881 ndr_print_ptr(ndr, "dns_name", r->dns_name);
6882 ndr->depth++;
6883 if (r->dns_name) {
6884 ndr_print_string(ndr, "dns_name", r->dns_name);
6886 ndr->depth--;
6887 ndr_print_ptr(ndr, "site_name", r->site_name);
6888 ndr->depth++;
6889 if (r->site_name) {
6890 ndr_print_string(ndr, "site_name", r->site_name);
6892 ndr->depth--;
6893 ndr_print_ptr(ndr, "site_dn", r->site_dn);
6894 ndr->depth++;
6895 if (r->site_dn) {
6896 ndr_print_string(ndr, "site_dn", r->site_dn);
6898 ndr->depth--;
6899 ndr_print_ptr(ndr, "computer_dn", r->computer_dn);
6900 ndr->depth++;
6901 if (r->computer_dn) {
6902 ndr_print_string(ndr, "computer_dn", r->computer_dn);
6904 ndr->depth--;
6905 ndr_print_ptr(ndr, "server_dn", r->server_dn);
6906 ndr->depth++;
6907 if (r->server_dn) {
6908 ndr_print_string(ndr, "server_dn", r->server_dn);
6910 ndr->depth--;
6911 ndr_print_ptr(ndr, "ntds_dn", r->ntds_dn);
6912 ndr->depth++;
6913 if (r->ntds_dn) {
6914 ndr_print_string(ndr, "ntds_dn", r->ntds_dn);
6916 ndr->depth--;
6917 ndr_print_uint32(ndr, "is_pdc", r->is_pdc);
6918 ndr_print_uint32(ndr, "is_enabled", r->is_enabled);
6919 ndr_print_uint32(ndr, "is_gc", r->is_gc);
6920 ndr_print_uint32(ndr, "is_rodc", r->is_rodc);
6921 ndr_print_GUID(ndr, "site_guid", &r->site_guid);
6922 ndr_print_GUID(ndr, "computer_guid", &r->computer_guid);
6923 ndr_print_GUID(ndr, "server_guid", &r->server_guid);
6924 ndr_print_GUID(ndr, "ntds_guid", &r->ntds_guid);
6925 ndr->depth--;
6928 static enum ndr_err_code ndr_push_drsuapi_DsGetDCInfoCtr3(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetDCInfoCtr3 *r)
6930 uint32_t cntr_array_1;
6931 if (ndr_flags & NDR_SCALARS) {
6932 NDR_CHECK(ndr_push_align(ndr, 4));
6933 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
6934 NDR_CHECK(ndr_push_unique_ptr(ndr, r->array));
6936 if (ndr_flags & NDR_BUFFERS) {
6937 if (r->array) {
6938 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
6939 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
6940 NDR_CHECK(ndr_push_drsuapi_DsGetDCInfo3(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
6942 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
6943 NDR_CHECK(ndr_push_drsuapi_DsGetDCInfo3(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
6947 return NDR_ERR_SUCCESS;
6950 static enum ndr_err_code ndr_pull_drsuapi_DsGetDCInfoCtr3(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetDCInfoCtr3 *r)
6952 uint32_t _ptr_array;
6953 uint32_t cntr_array_1;
6954 TALLOC_CTX *_mem_save_array_0;
6955 TALLOC_CTX *_mem_save_array_1;
6956 if (ndr_flags & NDR_SCALARS) {
6957 NDR_CHECK(ndr_pull_align(ndr, 4));
6958 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
6959 if (r->count > 10000) {
6960 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
6962 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array));
6963 if (_ptr_array) {
6964 NDR_PULL_ALLOC(ndr, r->array);
6965 } else {
6966 r->array = NULL;
6969 if (ndr_flags & NDR_BUFFERS) {
6970 if (r->array) {
6971 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
6972 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
6973 NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
6974 NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
6975 _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr);
6976 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
6977 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
6978 NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfo3(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
6980 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
6981 NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfo3(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
6983 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0);
6984 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
6986 if (r->array) {
6987 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
6990 return NDR_ERR_SUCCESS;
6993 _PUBLIC_ void ndr_print_drsuapi_DsGetDCInfoCtr3(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCInfoCtr3 *r)
6995 uint32_t cntr_array_1;
6996 ndr_print_struct(ndr, name, "drsuapi_DsGetDCInfoCtr3");
6997 ndr->depth++;
6998 ndr_print_uint32(ndr, "count", r->count);
6999 ndr_print_ptr(ndr, "array", r->array);
7000 ndr->depth++;
7001 if (r->array) {
7002 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
7003 ndr->depth++;
7004 for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) {
7005 char *idx_1=NULL;
7006 if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) {
7007 ndr_print_drsuapi_DsGetDCInfo3(ndr, "array", &r->array[cntr_array_1]);
7008 free(idx_1);
7011 ndr->depth--;
7013 ndr->depth--;
7014 ndr->depth--;
7017 static enum ndr_err_code ndr_push_drsuapi_DsGetDCConnection01(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetDCConnection01 *r)
7019 if (ndr_flags & NDR_SCALARS) {
7020 NDR_CHECK(ndr_push_align(ndr, 4));
7022 uint32_t _flags_save_ipv4address = ndr->flags;
7023 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
7024 NDR_CHECK(ndr_push_ipv4address(ndr, NDR_SCALARS, r->client_ip_address));
7025 ndr->flags = _flags_save_ipv4address;
7027 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2));
7028 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->connection_time));
7029 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown4));
7030 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5));
7031 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6));
7032 NDR_CHECK(ndr_push_unique_ptr(ndr, r->client_account));
7034 if (ndr_flags & NDR_BUFFERS) {
7035 if (r->client_account) {
7036 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client_account, CH_UTF16)));
7037 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
7038 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->client_account, CH_UTF16)));
7039 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->client_account, ndr_charset_length(r->client_account, CH_UTF16), sizeof(uint16_t), CH_UTF16));
7042 return NDR_ERR_SUCCESS;
7045 static enum ndr_err_code ndr_pull_drsuapi_DsGetDCConnection01(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetDCConnection01 *r)
7047 uint32_t _ptr_client_account;
7048 TALLOC_CTX *_mem_save_client_account_0;
7049 if (ndr_flags & NDR_SCALARS) {
7050 NDR_CHECK(ndr_pull_align(ndr, 4));
7052 uint32_t _flags_save_ipv4address = ndr->flags;
7053 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
7054 NDR_CHECK(ndr_pull_ipv4address(ndr, NDR_SCALARS, &r->client_ip_address));
7055 ndr->flags = _flags_save_ipv4address;
7057 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2));
7058 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->connection_time));
7059 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown4));
7060 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5));
7061 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6));
7062 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_client_account));
7063 if (_ptr_client_account) {
7064 NDR_PULL_ALLOC(ndr, r->client_account);
7065 } else {
7066 r->client_account = NULL;
7069 if (ndr_flags & NDR_BUFFERS) {
7070 if (r->client_account) {
7071 _mem_save_client_account_0 = NDR_PULL_GET_MEM_CTX(ndr);
7072 NDR_PULL_SET_MEM_CTX(ndr, r->client_account, 0);
7073 NDR_CHECK(ndr_pull_array_size(ndr, &r->client_account));
7074 NDR_CHECK(ndr_pull_array_length(ndr, &r->client_account));
7075 if (ndr_get_array_length(ndr, &r->client_account) > ndr_get_array_size(ndr, &r->client_account)) {
7076 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));
7078 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->client_account), sizeof(uint16_t)));
7079 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->client_account, ndr_get_array_length(ndr, &r->client_account), sizeof(uint16_t), CH_UTF16));
7080 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_account_0, 0);
7083 return NDR_ERR_SUCCESS;
7086 _PUBLIC_ void ndr_print_drsuapi_DsGetDCConnection01(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCConnection01 *r)
7088 ndr_print_struct(ndr, name, "drsuapi_DsGetDCConnection01");
7089 ndr->depth++;
7090 ndr_print_ipv4address(ndr, "client_ip_address", r->client_ip_address);
7091 ndr_print_uint32(ndr, "unknown2", r->unknown2);
7092 ndr_print_uint32(ndr, "connection_time", r->connection_time);
7093 ndr_print_uint32(ndr, "unknown4", r->unknown4);
7094 ndr_print_uint32(ndr, "unknown5", r->unknown5);
7095 ndr_print_uint32(ndr, "unknown6", r->unknown6);
7096 ndr_print_ptr(ndr, "client_account", r->client_account);
7097 ndr->depth++;
7098 if (r->client_account) {
7099 ndr_print_string(ndr, "client_account", r->client_account);
7101 ndr->depth--;
7102 ndr->depth--;
7105 static enum ndr_err_code ndr_push_drsuapi_DsGetDCConnectionCtr01(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetDCConnectionCtr01 *r)
7107 uint32_t cntr_array_1;
7108 if (ndr_flags & NDR_SCALARS) {
7109 NDR_CHECK(ndr_push_align(ndr, 4));
7110 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
7111 NDR_CHECK(ndr_push_unique_ptr(ndr, r->array));
7113 if (ndr_flags & NDR_BUFFERS) {
7114 if (r->array) {
7115 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
7116 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
7117 NDR_CHECK(ndr_push_drsuapi_DsGetDCConnection01(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
7119 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
7120 NDR_CHECK(ndr_push_drsuapi_DsGetDCConnection01(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
7124 return NDR_ERR_SUCCESS;
7127 static enum ndr_err_code ndr_pull_drsuapi_DsGetDCConnectionCtr01(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetDCConnectionCtr01 *r)
7129 uint32_t _ptr_array;
7130 uint32_t cntr_array_1;
7131 TALLOC_CTX *_mem_save_array_0;
7132 TALLOC_CTX *_mem_save_array_1;
7133 if (ndr_flags & NDR_SCALARS) {
7134 NDR_CHECK(ndr_pull_align(ndr, 4));
7135 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
7136 if (r->count > 10000) {
7137 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
7139 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array));
7140 if (_ptr_array) {
7141 NDR_PULL_ALLOC(ndr, r->array);
7142 } else {
7143 r->array = NULL;
7146 if (ndr_flags & NDR_BUFFERS) {
7147 if (r->array) {
7148 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
7149 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
7150 NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
7151 NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
7152 _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr);
7153 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
7154 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
7155 NDR_CHECK(ndr_pull_drsuapi_DsGetDCConnection01(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
7157 for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
7158 NDR_CHECK(ndr_pull_drsuapi_DsGetDCConnection01(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
7160 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0);
7161 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
7163 if (r->array) {
7164 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
7167 return NDR_ERR_SUCCESS;
7170 _PUBLIC_ void ndr_print_drsuapi_DsGetDCConnectionCtr01(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCConnectionCtr01 *r)
7172 uint32_t cntr_array_1;
7173 ndr_print_struct(ndr, name, "drsuapi_DsGetDCConnectionCtr01");
7174 ndr->depth++;
7175 ndr_print_uint32(ndr, "count", r->count);
7176 ndr_print_ptr(ndr, "array", r->array);
7177 ndr->depth++;
7178 if (r->array) {
7179 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
7180 ndr->depth++;
7181 for (cntr_array_1=0;cntr_array_1<r->count;cntr_array_1++) {
7182 char *idx_1=NULL;
7183 if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) {
7184 ndr_print_drsuapi_DsGetDCConnection01(ndr, "array", &r->array[cntr_array_1]);
7185 free(idx_1);
7188 ndr->depth--;
7190 ndr->depth--;
7191 ndr->depth--;
7194 static enum ndr_err_code ndr_push_drsuapi_DsGetDCInfoCtr(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetDCInfoCtr *r)
7196 if (ndr_flags & NDR_SCALARS) {
7197 int level = ndr_push_get_switch_value(ndr, r);
7198 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
7199 switch (level) {
7200 case DRSUAPI_DC_INFO_CTR_1: {
7201 NDR_CHECK(ndr_push_drsuapi_DsGetDCInfoCtr1(ndr, NDR_SCALARS, &r->ctr1));
7202 break; }
7204 case DRSUAPI_DC_INFO_CTR_2: {
7205 NDR_CHECK(ndr_push_drsuapi_DsGetDCInfoCtr2(ndr, NDR_SCALARS, &r->ctr2));
7206 break; }
7208 case DRSUAPI_DC_INFO_CTR_3: {
7209 NDR_CHECK(ndr_push_drsuapi_DsGetDCInfoCtr3(ndr, NDR_SCALARS, &r->ctr3));
7210 break; }
7212 case DRSUAPI_DC_CONNECTION_CTR_01: {
7213 NDR_CHECK(ndr_push_drsuapi_DsGetDCConnectionCtr01(ndr, NDR_SCALARS, &r->ctr01));
7214 break; }
7216 default:
7217 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
7220 if (ndr_flags & NDR_BUFFERS) {
7221 int level = ndr_push_get_switch_value(ndr, r);
7222 switch (level) {
7223 case DRSUAPI_DC_INFO_CTR_1:
7224 NDR_CHECK(ndr_push_drsuapi_DsGetDCInfoCtr1(ndr, NDR_BUFFERS, &r->ctr1));
7225 break;
7227 case DRSUAPI_DC_INFO_CTR_2:
7228 NDR_CHECK(ndr_push_drsuapi_DsGetDCInfoCtr2(ndr, NDR_BUFFERS, &r->ctr2));
7229 break;
7231 case DRSUAPI_DC_INFO_CTR_3:
7232 NDR_CHECK(ndr_push_drsuapi_DsGetDCInfoCtr3(ndr, NDR_BUFFERS, &r->ctr3));
7233 break;
7235 case DRSUAPI_DC_CONNECTION_CTR_01:
7236 NDR_CHECK(ndr_push_drsuapi_DsGetDCConnectionCtr01(ndr, NDR_BUFFERS, &r->ctr01));
7237 break;
7239 default:
7240 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
7243 return NDR_ERR_SUCCESS;
7246 static enum ndr_err_code ndr_pull_drsuapi_DsGetDCInfoCtr(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetDCInfoCtr *r)
7248 int level;
7249 int32_t _level;
7250 level = ndr_pull_get_switch_value(ndr, r);
7251 if (ndr_flags & NDR_SCALARS) {
7252 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
7253 if (_level != level) {
7254 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
7256 switch (level) {
7257 case DRSUAPI_DC_INFO_CTR_1: {
7258 NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfoCtr1(ndr, NDR_SCALARS, &r->ctr1));
7259 break; }
7261 case DRSUAPI_DC_INFO_CTR_2: {
7262 NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfoCtr2(ndr, NDR_SCALARS, &r->ctr2));
7263 break; }
7265 case DRSUAPI_DC_INFO_CTR_3: {
7266 NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfoCtr3(ndr, NDR_SCALARS, &r->ctr3));
7267 break; }
7269 case DRSUAPI_DC_CONNECTION_CTR_01: {
7270 NDR_CHECK(ndr_pull_drsuapi_DsGetDCConnectionCtr01(ndr, NDR_SCALARS, &r->ctr01));
7271 break; }
7273 default:
7274 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
7277 if (ndr_flags & NDR_BUFFERS) {
7278 switch (level) {
7279 case DRSUAPI_DC_INFO_CTR_1:
7280 NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfoCtr1(ndr, NDR_BUFFERS, &r->ctr1));
7281 break;
7283 case DRSUAPI_DC_INFO_CTR_2:
7284 NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfoCtr2(ndr, NDR_BUFFERS, &r->ctr2));
7285 break;
7287 case DRSUAPI_DC_INFO_CTR_3:
7288 NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfoCtr3(ndr, NDR_BUFFERS, &r->ctr3));
7289 break;
7291 case DRSUAPI_DC_CONNECTION_CTR_01:
7292 NDR_CHECK(ndr_pull_drsuapi_DsGetDCConnectionCtr01(ndr, NDR_BUFFERS, &r->ctr01));
7293 break;
7295 default:
7296 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
7299 return NDR_ERR_SUCCESS;
7302 _PUBLIC_ void ndr_print_drsuapi_DsGetDCInfoCtr(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetDCInfoCtr *r)
7304 int level;
7305 level = ndr_print_get_switch_value(ndr, r);
7306 ndr_print_union(ndr, name, level, "drsuapi_DsGetDCInfoCtr");
7307 switch (level) {
7308 case DRSUAPI_DC_INFO_CTR_1:
7309 ndr_print_drsuapi_DsGetDCInfoCtr1(ndr, "ctr1", &r->ctr1);
7310 break;
7312 case DRSUAPI_DC_INFO_CTR_2:
7313 ndr_print_drsuapi_DsGetDCInfoCtr2(ndr, "ctr2", &r->ctr2);
7314 break;
7316 case DRSUAPI_DC_INFO_CTR_3:
7317 ndr_print_drsuapi_DsGetDCInfoCtr3(ndr, "ctr3", &r->ctr3);
7318 break;
7320 case DRSUAPI_DC_CONNECTION_CTR_01:
7321 ndr_print_drsuapi_DsGetDCConnectionCtr01(ndr, "ctr01", &r->ctr01);
7322 break;
7324 default:
7325 ndr_print_bad_level(ndr, name, level);
7329 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectListItem(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectListItem *r)
7331 if (ndr_flags & NDR_SCALARS) {
7332 NDR_CHECK(ndr_push_align(ndr, 4));
7333 NDR_CHECK(ndr_push_unique_ptr(ndr, r->next_object));
7334 NDR_CHECK(ndr_push_drsuapi_DsReplicaObject(ndr, NDR_SCALARS, &r->object));
7336 if (ndr_flags & NDR_BUFFERS) {
7337 if (r->next_object) {
7338 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectListItem(ndr, NDR_SCALARS|NDR_BUFFERS, r->next_object));
7340 NDR_CHECK(ndr_push_drsuapi_DsReplicaObject(ndr, NDR_BUFFERS, &r->object));
7342 return NDR_ERR_SUCCESS;
7345 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectListItem(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectListItem *r)
7347 uint32_t _ptr_next_object;
7348 TALLOC_CTX *_mem_save_next_object_0;
7349 if (ndr_flags & NDR_SCALARS) {
7350 NDR_CHECK(ndr_pull_align(ndr, 4));
7351 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_next_object));
7352 if (_ptr_next_object) {
7353 NDR_PULL_ALLOC(ndr, r->next_object);
7354 } else {
7355 r->next_object = NULL;
7357 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObject(ndr, NDR_SCALARS, &r->object));
7359 if (ndr_flags & NDR_BUFFERS) {
7360 if (r->next_object) {
7361 _mem_save_next_object_0 = NDR_PULL_GET_MEM_CTX(ndr);
7362 NDR_PULL_SET_MEM_CTX(ndr, r->next_object, 0);
7363 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectListItem(ndr, NDR_SCALARS|NDR_BUFFERS, r->next_object));
7364 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_next_object_0, 0);
7366 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObject(ndr, NDR_BUFFERS, &r->object));
7368 return NDR_ERR_SUCCESS;
7371 static enum ndr_err_code ndr_push_drsuapi_DsAddEntryRequest2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAddEntryRequest2 *r)
7373 if (ndr_flags & NDR_SCALARS) {
7374 NDR_CHECK(ndr_push_align(ndr, 4));
7375 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectListItem(ndr, NDR_SCALARS, &r->first_object));
7377 if (ndr_flags & NDR_BUFFERS) {
7378 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectListItem(ndr, NDR_BUFFERS, &r->first_object));
7380 return NDR_ERR_SUCCESS;
7383 static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryRequest2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAddEntryRequest2 *r)
7385 if (ndr_flags & NDR_SCALARS) {
7386 NDR_CHECK(ndr_pull_align(ndr, 4));
7387 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectListItem(ndr, NDR_SCALARS, &r->first_object));
7389 if (ndr_flags & NDR_BUFFERS) {
7390 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectListItem(ndr, NDR_BUFFERS, &r->first_object));
7392 return NDR_ERR_SUCCESS;
7395 _PUBLIC_ void ndr_print_drsuapi_DsAddEntryRequest2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryRequest2 *r)
7397 ndr_print_struct(ndr, name, "drsuapi_DsAddEntryRequest2");
7398 ndr->depth++;
7399 ndr_print_drsuapi_DsReplicaObjectListItem(ndr, "first_object", &r->first_object);
7400 ndr->depth--;
7403 static enum ndr_err_code ndr_push_drsuapi_DsAddEntryRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsAddEntryRequest *r)
7405 if (ndr_flags & NDR_SCALARS) {
7406 int level = ndr_push_get_switch_value(ndr, r);
7407 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
7408 switch (level) {
7409 case 2: {
7410 NDR_CHECK(ndr_push_drsuapi_DsAddEntryRequest2(ndr, NDR_SCALARS, &r->req2));
7411 break; }
7413 default:
7414 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
7417 if (ndr_flags & NDR_BUFFERS) {
7418 int level = ndr_push_get_switch_value(ndr, r);
7419 switch (level) {
7420 case 2:
7421 NDR_CHECK(ndr_push_drsuapi_DsAddEntryRequest2(ndr, NDR_BUFFERS, &r->req2));
7422 break;
7424 default:
7425 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
7428 return NDR_ERR_SUCCESS;
7431 static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsAddEntryRequest *r)
7433 int level;
7434 int32_t _level;
7435 level = ndr_pull_get_switch_value(ndr, r);
7436 if (ndr_flags & NDR_SCALARS) {
7437 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
7438 if (_level != level) {
7439 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
7441 switch (level) {
7442 case 2: {
7443 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryRequest2(ndr, NDR_SCALARS, &r->req2));
7444 break; }
7446 default:
7447 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
7450 if (ndr_flags & NDR_BUFFERS) {
7451 switch (level) {
7452 case 2:
7453 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryRequest2(ndr, NDR_BUFFERS, &r->req2));
7454 break;
7456 default:
7457 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
7460 return NDR_ERR_SUCCESS;
7463 _PUBLIC_ void ndr_print_drsuapi_DsAddEntryRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsAddEntryRequest *r)
7465 int level;
7466 level = ndr_print_get_switch_value(ndr, r);
7467 ndr_print_union(ndr, name, level, "drsuapi_DsAddEntryRequest");
7468 switch (level) {
7469 case 2:
7470 ndr_print_drsuapi_DsAddEntryRequest2(ndr, "req2", &r->req2);
7471 break;
7473 default:
7474 ndr_print_bad_level(ndr, name, level);
7478 static enum ndr_err_code ndr_push_drsuapi_DsAddEntryErrorInfoX(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAddEntryErrorInfoX *r)
7480 if (ndr_flags & NDR_SCALARS) {
7481 NDR_CHECK(ndr_push_align(ndr, 4));
7482 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1));
7483 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->status));
7484 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2));
7485 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->unknown3));
7487 if (ndr_flags & NDR_BUFFERS) {
7489 return NDR_ERR_SUCCESS;
7492 static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryErrorInfoX(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAddEntryErrorInfoX *r)
7494 if (ndr_flags & NDR_SCALARS) {
7495 NDR_CHECK(ndr_pull_align(ndr, 4));
7496 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1));
7497 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->status));
7498 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2));
7499 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->unknown3));
7501 if (ndr_flags & NDR_BUFFERS) {
7503 return NDR_ERR_SUCCESS;
7506 _PUBLIC_ void ndr_print_drsuapi_DsAddEntryErrorInfoX(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryErrorInfoX *r)
7508 ndr_print_struct(ndr, name, "drsuapi_DsAddEntryErrorInfoX");
7509 ndr->depth++;
7510 ndr_print_uint32(ndr, "unknown1", r->unknown1);
7511 ndr_print_WERROR(ndr, "status", r->status);
7512 ndr_print_uint32(ndr, "unknown2", r->unknown2);
7513 ndr_print_uint16(ndr, "unknown3", r->unknown3);
7514 ndr->depth--;
7517 static enum ndr_err_code ndr_push_drsuapi_DsAddEntryExtraErrorBuffer(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAddEntryExtraErrorBuffer *r)
7519 if (ndr_flags & NDR_SCALARS) {
7520 NDR_CHECK(ndr_push_align(ndr, 4));
7521 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size));
7522 NDR_CHECK(ndr_push_unique_ptr(ndr, r->data));
7524 if (ndr_flags & NDR_BUFFERS) {
7525 if (r->data) {
7526 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size));
7527 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->size));
7530 return NDR_ERR_SUCCESS;
7533 static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryExtraErrorBuffer(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAddEntryExtraErrorBuffer *r)
7535 uint32_t _ptr_data;
7536 TALLOC_CTX *_mem_save_data_0;
7537 if (ndr_flags & NDR_SCALARS) {
7538 NDR_CHECK(ndr_pull_align(ndr, 4));
7539 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size));
7540 if (r->size > 10485760) {
7541 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
7543 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data));
7544 if (_ptr_data) {
7545 NDR_PULL_ALLOC(ndr, r->data);
7546 } else {
7547 r->data = NULL;
7550 if (ndr_flags & NDR_BUFFERS) {
7551 if (r->data) {
7552 _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
7553 NDR_PULL_SET_MEM_CTX(ndr, r->data, 0);
7554 NDR_CHECK(ndr_pull_array_size(ndr, &r->data));
7555 NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data));
7556 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, ndr_get_array_size(ndr, &r->data)));
7557 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0);
7559 if (r->data) {
7560 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->size));
7563 return NDR_ERR_SUCCESS;
7566 _PUBLIC_ void ndr_print_drsuapi_DsAddEntryExtraErrorBuffer(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryExtraErrorBuffer *r)
7568 ndr_print_struct(ndr, name, "drsuapi_DsAddEntryExtraErrorBuffer");
7569 ndr->depth++;
7570 ndr_print_uint32(ndr, "size", r->size);
7571 ndr_print_ptr(ndr, "data", r->data);
7572 ndr->depth++;
7573 if (r->data) {
7574 ndr_print_array_uint8(ndr, "data", r->data, r->size);
7576 ndr->depth--;
7577 ndr->depth--;
7580 static enum ndr_err_code ndr_push_drsuapi_DsAddEntryExtraError1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAddEntryExtraError1 *r)
7582 if (ndr_flags & NDR_SCALARS) {
7583 NDR_CHECK(ndr_push_align(ndr, 4));
7584 NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->error));
7585 NDR_CHECK(ndr_push_drsuapi_DsAttributeId(ndr, NDR_SCALARS, r->attid));
7586 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2));
7587 NDR_CHECK(ndr_push_drsuapi_DsAddEntryExtraErrorBuffer(ndr, NDR_SCALARS, &r->buffer));
7589 if (ndr_flags & NDR_BUFFERS) {
7590 NDR_CHECK(ndr_push_drsuapi_DsAddEntryExtraErrorBuffer(ndr, NDR_BUFFERS, &r->buffer));
7592 return NDR_ERR_SUCCESS;
7595 static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryExtraError1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAddEntryExtraError1 *r)
7597 if (ndr_flags & NDR_SCALARS) {
7598 NDR_CHECK(ndr_pull_align(ndr, 4));
7599 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->error));
7600 NDR_CHECK(ndr_pull_drsuapi_DsAttributeId(ndr, NDR_SCALARS, &r->attid));
7601 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2));
7602 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryExtraErrorBuffer(ndr, NDR_SCALARS, &r->buffer));
7604 if (ndr_flags & NDR_BUFFERS) {
7605 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryExtraErrorBuffer(ndr, NDR_BUFFERS, &r->buffer));
7607 return NDR_ERR_SUCCESS;
7610 _PUBLIC_ void ndr_print_drsuapi_DsAddEntryExtraError1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryExtraError1 *r)
7612 ndr_print_struct(ndr, name, "drsuapi_DsAddEntryExtraError1");
7613 ndr->depth++;
7614 ndr_print_drsuapi_DsAddEntryErrorInfoX(ndr, "error", &r->error);
7615 ndr_print_drsuapi_DsAttributeId(ndr, "attid", r->attid);
7616 ndr_print_uint32(ndr, "unknown2", r->unknown2);
7617 ndr_print_drsuapi_DsAddEntryExtraErrorBuffer(ndr, "buffer", &r->buffer);
7618 ndr->depth--;
7621 static enum ndr_err_code ndr_push_drsuapi_DsAddEntryErrorListItem1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAddEntryErrorListItem1 *r)
7623 if (ndr_flags & NDR_SCALARS) {
7624 NDR_CHECK(ndr_push_align(ndr, 4));
7625 NDR_CHECK(ndr_push_unique_ptr(ndr, r->next));
7626 NDR_CHECK(ndr_push_drsuapi_DsAddEntryExtraError1(ndr, NDR_SCALARS, &r->error));
7628 if (ndr_flags & NDR_BUFFERS) {
7629 if (r->next) {
7630 NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorListItem1(ndr, NDR_SCALARS|NDR_BUFFERS, r->next));
7632 NDR_CHECK(ndr_push_drsuapi_DsAddEntryExtraError1(ndr, NDR_BUFFERS, &r->error));
7634 return NDR_ERR_SUCCESS;
7637 static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryErrorListItem1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAddEntryErrorListItem1 *r)
7639 uint32_t _ptr_next;
7640 TALLOC_CTX *_mem_save_next_0;
7641 if (ndr_flags & NDR_SCALARS) {
7642 NDR_CHECK(ndr_pull_align(ndr, 4));
7643 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_next));
7644 if (_ptr_next) {
7645 NDR_PULL_ALLOC(ndr, r->next);
7646 } else {
7647 r->next = NULL;
7649 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryExtraError1(ndr, NDR_SCALARS, &r->error));
7651 if (ndr_flags & NDR_BUFFERS) {
7652 if (r->next) {
7653 _mem_save_next_0 = NDR_PULL_GET_MEM_CTX(ndr);
7654 NDR_PULL_SET_MEM_CTX(ndr, r->next, 0);
7655 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorListItem1(ndr, NDR_SCALARS|NDR_BUFFERS, r->next));
7656 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_next_0, 0);
7658 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryExtraError1(ndr, NDR_BUFFERS, &r->error));
7660 return NDR_ERR_SUCCESS;
7663 _PUBLIC_ void ndr_print_drsuapi_DsAddEntryErrorListItem1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryErrorListItem1 *r)
7665 ndr_print_struct(ndr, name, "drsuapi_DsAddEntryErrorListItem1");
7666 ndr->depth++;
7667 ndr_print_ptr(ndr, "next", r->next);
7668 ndr->depth++;
7669 if (r->next) {
7670 ndr_print_drsuapi_DsAddEntryErrorListItem1(ndr, "next", r->next);
7672 ndr->depth--;
7673 ndr_print_drsuapi_DsAddEntryExtraError1(ndr, "error", &r->error);
7674 ndr->depth--;
7677 static enum ndr_err_code ndr_push_drsuapi_DsAddEntryErrorInfo1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAddEntryErrorInfo1 *r)
7679 if (ndr_flags & NDR_SCALARS) {
7680 NDR_CHECK(ndr_push_align(ndr, 4));
7681 NDR_CHECK(ndr_push_unique_ptr(ndr, r->id));
7682 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->status));
7683 NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorListItem1(ndr, NDR_SCALARS, &r->first));
7685 if (ndr_flags & NDR_BUFFERS) {
7686 if (r->id) {
7687 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->id));
7689 NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorListItem1(ndr, NDR_BUFFERS, &r->first));
7691 return NDR_ERR_SUCCESS;
7694 static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryErrorInfo1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAddEntryErrorInfo1 *r)
7696 uint32_t _ptr_id;
7697 TALLOC_CTX *_mem_save_id_0;
7698 if (ndr_flags & NDR_SCALARS) {
7699 NDR_CHECK(ndr_pull_align(ndr, 4));
7700 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_id));
7701 if (_ptr_id) {
7702 NDR_PULL_ALLOC(ndr, r->id);
7703 } else {
7704 r->id = NULL;
7706 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->status));
7707 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorListItem1(ndr, NDR_SCALARS, &r->first));
7709 if (ndr_flags & NDR_BUFFERS) {
7710 if (r->id) {
7711 _mem_save_id_0 = NDR_PULL_GET_MEM_CTX(ndr);
7712 NDR_PULL_SET_MEM_CTX(ndr, r->id, 0);
7713 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->id));
7714 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_id_0, 0);
7716 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorListItem1(ndr, NDR_BUFFERS, &r->first));
7718 return NDR_ERR_SUCCESS;
7721 _PUBLIC_ void ndr_print_drsuapi_DsAddEntryErrorInfo1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryErrorInfo1 *r)
7723 ndr_print_struct(ndr, name, "drsuapi_DsAddEntryErrorInfo1");
7724 ndr->depth++;
7725 ndr_print_ptr(ndr, "id", r->id);
7726 ndr->depth++;
7727 if (r->id) {
7728 ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "id", r->id);
7730 ndr->depth--;
7731 ndr_print_WERROR(ndr, "status", r->status);
7732 ndr_print_drsuapi_DsAddEntryErrorListItem1(ndr, "first", &r->first);
7733 ndr->depth--;
7736 static enum ndr_err_code ndr_push_drsuapi_DsAddEntryErrorInfo(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsAddEntryErrorInfo *r)
7738 if (ndr_flags & NDR_SCALARS) {
7739 int level = ndr_push_get_switch_value(ndr, r);
7740 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level));
7741 switch (level) {
7742 case 1: {
7743 NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorInfo1(ndr, NDR_SCALARS, &r->error1));
7744 break; }
7746 case 4: {
7747 NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->errorX));
7748 break; }
7750 case 5: {
7751 NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->errorX));
7752 break; }
7754 case 6: {
7755 NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->errorX));
7756 break; }
7758 case 7: {
7759 NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->errorX));
7760 break; }
7762 default:
7763 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
7766 if (ndr_flags & NDR_BUFFERS) {
7767 int level = ndr_push_get_switch_value(ndr, r);
7768 switch (level) {
7769 case 1:
7770 NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorInfo1(ndr, NDR_BUFFERS, &r->error1));
7771 break;
7773 case 4:
7774 break;
7776 case 5:
7777 break;
7779 case 6:
7780 break;
7782 case 7:
7783 break;
7785 default:
7786 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
7789 return NDR_ERR_SUCCESS;
7792 static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryErrorInfo(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsAddEntryErrorInfo *r)
7794 int level;
7795 uint32_t _level;
7796 level = ndr_pull_get_switch_value(ndr, r);
7797 if (ndr_flags & NDR_SCALARS) {
7798 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
7799 if (_level != level) {
7800 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
7802 switch (level) {
7803 case 1: {
7804 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorInfo1(ndr, NDR_SCALARS, &r->error1));
7805 break; }
7807 case 4: {
7808 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->errorX));
7809 break; }
7811 case 5: {
7812 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->errorX));
7813 break; }
7815 case 6: {
7816 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->errorX));
7817 break; }
7819 case 7: {
7820 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->errorX));
7821 break; }
7823 default:
7824 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
7827 if (ndr_flags & NDR_BUFFERS) {
7828 switch (level) {
7829 case 1:
7830 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorInfo1(ndr, NDR_BUFFERS, &r->error1));
7831 break;
7833 case 4:
7834 break;
7836 case 5:
7837 break;
7839 case 6:
7840 break;
7842 case 7:
7843 break;
7845 default:
7846 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
7849 return NDR_ERR_SUCCESS;
7852 _PUBLIC_ void ndr_print_drsuapi_DsAddEntryErrorInfo(struct ndr_print *ndr, const char *name, const union drsuapi_DsAddEntryErrorInfo *r)
7854 int level;
7855 level = ndr_print_get_switch_value(ndr, r);
7856 ndr_print_union(ndr, name, level, "drsuapi_DsAddEntryErrorInfo");
7857 switch (level) {
7858 case 1:
7859 ndr_print_drsuapi_DsAddEntryErrorInfo1(ndr, "error1", &r->error1);
7860 break;
7862 case 4:
7863 ndr_print_drsuapi_DsAddEntryErrorInfoX(ndr, "errorX", &r->errorX);
7864 break;
7866 case 5:
7867 ndr_print_drsuapi_DsAddEntryErrorInfoX(ndr, "errorX", &r->errorX);
7868 break;
7870 case 6:
7871 ndr_print_drsuapi_DsAddEntryErrorInfoX(ndr, "errorX", &r->errorX);
7872 break;
7874 case 7:
7875 ndr_print_drsuapi_DsAddEntryErrorInfoX(ndr, "errorX", &r->errorX);
7876 break;
7878 default:
7879 ndr_print_bad_level(ndr, name, level);
7883 static enum ndr_err_code ndr_push_drsuapi_DsAddEntryError1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAddEntryError1 *r)
7885 if (ndr_flags & NDR_SCALARS) {
7886 NDR_CHECK(ndr_push_align(ndr, 4));
7887 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->status));
7888 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level));
7889 NDR_CHECK(ndr_push_unique_ptr(ndr, r->info));
7891 if (ndr_flags & NDR_BUFFERS) {
7892 if (r->info) {
7893 NDR_CHECK(ndr_push_set_switch_value(ndr, r->info, r->level));
7894 NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->info));
7897 return NDR_ERR_SUCCESS;
7900 static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryError1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAddEntryError1 *r)
7902 uint32_t _ptr_info;
7903 TALLOC_CTX *_mem_save_info_0;
7904 if (ndr_flags & NDR_SCALARS) {
7905 NDR_CHECK(ndr_pull_align(ndr, 4));
7906 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->status));
7907 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level));
7908 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info));
7909 if (_ptr_info) {
7910 NDR_PULL_ALLOC(ndr, r->info);
7911 } else {
7912 r->info = NULL;
7915 if (ndr_flags & NDR_BUFFERS) {
7916 if (r->info) {
7917 _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
7918 NDR_PULL_SET_MEM_CTX(ndr, r->info, 0);
7919 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->info, r->level));
7920 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->info));
7921 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0);
7924 return NDR_ERR_SUCCESS;
7927 _PUBLIC_ void ndr_print_drsuapi_DsAddEntryError1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryError1 *r)
7929 ndr_print_struct(ndr, name, "drsuapi_DsAddEntryError1");
7930 ndr->depth++;
7931 ndr_print_WERROR(ndr, "status", r->status);
7932 ndr_print_uint32(ndr, "level", r->level);
7933 ndr_print_ptr(ndr, "info", r->info);
7934 ndr->depth++;
7935 if (r->info) {
7936 ndr_print_set_switch_value(ndr, r->info, r->level);
7937 ndr_print_drsuapi_DsAddEntryErrorInfo(ndr, "info", r->info);
7939 ndr->depth--;
7940 ndr->depth--;
7943 static enum ndr_err_code ndr_push_drsuapi_DsAddEntryError(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsAddEntryError *r)
7945 if (ndr_flags & NDR_SCALARS) {
7946 int level = ndr_push_get_switch_value(ndr, r);
7947 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level));
7948 switch (level) {
7949 case 1: {
7950 NDR_CHECK(ndr_push_drsuapi_DsAddEntryError1(ndr, NDR_SCALARS, &r->info1));
7951 break; }
7953 default:
7954 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
7957 if (ndr_flags & NDR_BUFFERS) {
7958 int level = ndr_push_get_switch_value(ndr, r);
7959 switch (level) {
7960 case 1:
7961 NDR_CHECK(ndr_push_drsuapi_DsAddEntryError1(ndr, NDR_BUFFERS, &r->info1));
7962 break;
7964 default:
7965 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
7968 return NDR_ERR_SUCCESS;
7971 static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryError(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsAddEntryError *r)
7973 int level;
7974 uint32_t _level;
7975 level = ndr_pull_get_switch_value(ndr, r);
7976 if (ndr_flags & NDR_SCALARS) {
7977 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
7978 if (_level != level) {
7979 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
7981 switch (level) {
7982 case 1: {
7983 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryError1(ndr, NDR_SCALARS, &r->info1));
7984 break; }
7986 default:
7987 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
7990 if (ndr_flags & NDR_BUFFERS) {
7991 switch (level) {
7992 case 1:
7993 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryError1(ndr, NDR_BUFFERS, &r->info1));
7994 break;
7996 default:
7997 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
8000 return NDR_ERR_SUCCESS;
8003 _PUBLIC_ void ndr_print_drsuapi_DsAddEntryError(struct ndr_print *ndr, const char *name, const union drsuapi_DsAddEntryError *r)
8005 int level;
8006 level = ndr_print_get_switch_value(ndr, r);
8007 ndr_print_union(ndr, name, level, "drsuapi_DsAddEntryError");
8008 switch (level) {
8009 case 1:
8010 ndr_print_drsuapi_DsAddEntryError1(ndr, "info1", &r->info1);
8011 break;
8013 default:
8014 ndr_print_bad_level(ndr, name, level);
8018 static enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectIdentifier2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectIdentifier2 *r)
8020 if (ndr_flags & NDR_SCALARS) {
8021 NDR_CHECK(ndr_push_align(ndr, 4));
8022 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->guid));
8023 NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_SCALARS, &r->sid));
8025 if (ndr_flags & NDR_BUFFERS) {
8026 NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_BUFFERS, &r->sid));
8028 return NDR_ERR_SUCCESS;
8031 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectIdentifier2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectIdentifier2 *r)
8033 if (ndr_flags & NDR_SCALARS) {
8034 NDR_CHECK(ndr_pull_align(ndr, 4));
8035 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->guid));
8036 NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_SCALARS, &r->sid));
8038 if (ndr_flags & NDR_BUFFERS) {
8039 NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_BUFFERS, &r->sid));
8041 return NDR_ERR_SUCCESS;
8044 _PUBLIC_ void ndr_print_drsuapi_DsReplicaObjectIdentifier2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjectIdentifier2 *r)
8046 ndr_print_struct(ndr, name, "drsuapi_DsReplicaObjectIdentifier2");
8047 ndr->depth++;
8048 ndr_print_GUID(ndr, "guid", &r->guid);
8049 ndr_print_dom_sid28(ndr, "sid", &r->sid);
8050 ndr->depth--;
8053 static enum ndr_err_code ndr_push_drsuapi_DsAddEntryCtr2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAddEntryCtr2 *r)
8055 uint32_t cntr_objects_1;
8056 if (ndr_flags & NDR_SCALARS) {
8057 NDR_CHECK(ndr_push_align(ndr, 4));
8058 NDR_CHECK(ndr_push_unique_ptr(ndr, r->id));
8059 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1));
8060 NDR_CHECK(ndr_push_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->error));
8061 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
8062 NDR_CHECK(ndr_push_unique_ptr(ndr, r->objects));
8064 if (ndr_flags & NDR_BUFFERS) {
8065 if (r->id) {
8066 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->id));
8068 if (r->objects) {
8069 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
8070 for (cntr_objects_1 = 0; cntr_objects_1 < r->count; cntr_objects_1++) {
8071 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier2(ndr, NDR_SCALARS, &r->objects[cntr_objects_1]));
8073 for (cntr_objects_1 = 0; cntr_objects_1 < r->count; cntr_objects_1++) {
8074 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier2(ndr, NDR_BUFFERS, &r->objects[cntr_objects_1]));
8078 return NDR_ERR_SUCCESS;
8081 static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryCtr2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAddEntryCtr2 *r)
8083 uint32_t _ptr_id;
8084 TALLOC_CTX *_mem_save_id_0;
8085 uint32_t _ptr_objects;
8086 uint32_t cntr_objects_1;
8087 TALLOC_CTX *_mem_save_objects_0;
8088 TALLOC_CTX *_mem_save_objects_1;
8089 if (ndr_flags & NDR_SCALARS) {
8090 NDR_CHECK(ndr_pull_align(ndr, 4));
8091 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_id));
8092 if (_ptr_id) {
8093 NDR_PULL_ALLOC(ndr, r->id);
8094 } else {
8095 r->id = NULL;
8097 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1));
8098 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryErrorInfoX(ndr, NDR_SCALARS, &r->error));
8099 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
8100 if (r->count > 10000) {
8101 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
8103 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_objects));
8104 if (_ptr_objects) {
8105 NDR_PULL_ALLOC(ndr, r->objects);
8106 } else {
8107 r->objects = NULL;
8110 if (ndr_flags & NDR_BUFFERS) {
8111 if (r->id) {
8112 _mem_save_id_0 = NDR_PULL_GET_MEM_CTX(ndr);
8113 NDR_PULL_SET_MEM_CTX(ndr, r->id, 0);
8114 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->id));
8115 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_id_0, 0);
8117 if (r->objects) {
8118 _mem_save_objects_0 = NDR_PULL_GET_MEM_CTX(ndr);
8119 NDR_PULL_SET_MEM_CTX(ndr, r->objects, 0);
8120 NDR_CHECK(ndr_pull_array_size(ndr, &r->objects));
8121 NDR_PULL_ALLOC_N(ndr, r->objects, ndr_get_array_size(ndr, &r->objects));
8122 _mem_save_objects_1 = NDR_PULL_GET_MEM_CTX(ndr);
8123 NDR_PULL_SET_MEM_CTX(ndr, r->objects, 0);
8124 for (cntr_objects_1 = 0; cntr_objects_1 < r->count; cntr_objects_1++) {
8125 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier2(ndr, NDR_SCALARS, &r->objects[cntr_objects_1]));
8127 for (cntr_objects_1 = 0; cntr_objects_1 < r->count; cntr_objects_1++) {
8128 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier2(ndr, NDR_BUFFERS, &r->objects[cntr_objects_1]));
8130 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_objects_1, 0);
8131 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_objects_0, 0);
8133 if (r->objects) {
8134 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->objects, r->count));
8137 return NDR_ERR_SUCCESS;
8140 _PUBLIC_ void ndr_print_drsuapi_DsAddEntryCtr2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryCtr2 *r)
8142 uint32_t cntr_objects_1;
8143 ndr_print_struct(ndr, name, "drsuapi_DsAddEntryCtr2");
8144 ndr->depth++;
8145 ndr_print_ptr(ndr, "id", r->id);
8146 ndr->depth++;
8147 if (r->id) {
8148 ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "id", r->id);
8150 ndr->depth--;
8151 ndr_print_uint32(ndr, "unknown1", r->unknown1);
8152 ndr_print_drsuapi_DsAddEntryErrorInfoX(ndr, "error", &r->error);
8153 ndr_print_uint32(ndr, "count", r->count);
8154 ndr_print_ptr(ndr, "objects", r->objects);
8155 ndr->depth++;
8156 if (r->objects) {
8157 ndr->print(ndr, "%s: ARRAY(%d)", "objects", (int)r->count);
8158 ndr->depth++;
8159 for (cntr_objects_1=0;cntr_objects_1<r->count;cntr_objects_1++) {
8160 char *idx_1=NULL;
8161 if (asprintf(&idx_1, "[%d]", cntr_objects_1) != -1) {
8162 ndr_print_drsuapi_DsReplicaObjectIdentifier2(ndr, "objects", &r->objects[cntr_objects_1]);
8163 free(idx_1);
8166 ndr->depth--;
8168 ndr->depth--;
8169 ndr->depth--;
8172 static enum ndr_err_code ndr_push_drsuapi_DsAddEntryCtr3(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAddEntryCtr3 *r)
8174 uint32_t cntr_objects_1;
8175 if (ndr_flags & NDR_SCALARS) {
8176 NDR_CHECK(ndr_push_align(ndr, 4));
8177 NDR_CHECK(ndr_push_unique_ptr(ndr, r->id));
8178 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level));
8179 NDR_CHECK(ndr_push_unique_ptr(ndr, r->error));
8180 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
8181 NDR_CHECK(ndr_push_unique_ptr(ndr, r->objects));
8183 if (ndr_flags & NDR_BUFFERS) {
8184 if (r->id) {
8185 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->id));
8187 if (r->error) {
8188 NDR_CHECK(ndr_push_set_switch_value(ndr, r->error, r->level));
8189 NDR_CHECK(ndr_push_drsuapi_DsAddEntryError(ndr, NDR_SCALARS|NDR_BUFFERS, r->error));
8191 if (r->objects) {
8192 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
8193 for (cntr_objects_1 = 0; cntr_objects_1 < r->count; cntr_objects_1++) {
8194 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier2(ndr, NDR_SCALARS, &r->objects[cntr_objects_1]));
8196 for (cntr_objects_1 = 0; cntr_objects_1 < r->count; cntr_objects_1++) {
8197 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier2(ndr, NDR_BUFFERS, &r->objects[cntr_objects_1]));
8201 return NDR_ERR_SUCCESS;
8204 static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryCtr3(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAddEntryCtr3 *r)
8206 uint32_t _ptr_id;
8207 TALLOC_CTX *_mem_save_id_0;
8208 uint32_t _ptr_error;
8209 TALLOC_CTX *_mem_save_error_0;
8210 uint32_t _ptr_objects;
8211 uint32_t cntr_objects_1;
8212 TALLOC_CTX *_mem_save_objects_0;
8213 TALLOC_CTX *_mem_save_objects_1;
8214 if (ndr_flags & NDR_SCALARS) {
8215 NDR_CHECK(ndr_pull_align(ndr, 4));
8216 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_id));
8217 if (_ptr_id) {
8218 NDR_PULL_ALLOC(ndr, r->id);
8219 } else {
8220 r->id = NULL;
8222 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level));
8223 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_error));
8224 if (_ptr_error) {
8225 NDR_PULL_ALLOC(ndr, r->error);
8226 } else {
8227 r->error = NULL;
8229 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
8230 if (r->count > 10000) {
8231 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
8233 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_objects));
8234 if (_ptr_objects) {
8235 NDR_PULL_ALLOC(ndr, r->objects);
8236 } else {
8237 r->objects = NULL;
8240 if (ndr_flags & NDR_BUFFERS) {
8241 if (r->id) {
8242 _mem_save_id_0 = NDR_PULL_GET_MEM_CTX(ndr);
8243 NDR_PULL_SET_MEM_CTX(ndr, r->id, 0);
8244 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->id));
8245 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_id_0, 0);
8247 if (r->error) {
8248 _mem_save_error_0 = NDR_PULL_GET_MEM_CTX(ndr);
8249 NDR_PULL_SET_MEM_CTX(ndr, r->error, 0);
8250 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->error, r->level));
8251 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryError(ndr, NDR_SCALARS|NDR_BUFFERS, r->error));
8252 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_error_0, 0);
8254 if (r->objects) {
8255 _mem_save_objects_0 = NDR_PULL_GET_MEM_CTX(ndr);
8256 NDR_PULL_SET_MEM_CTX(ndr, r->objects, 0);
8257 NDR_CHECK(ndr_pull_array_size(ndr, &r->objects));
8258 NDR_PULL_ALLOC_N(ndr, r->objects, ndr_get_array_size(ndr, &r->objects));
8259 _mem_save_objects_1 = NDR_PULL_GET_MEM_CTX(ndr);
8260 NDR_PULL_SET_MEM_CTX(ndr, r->objects, 0);
8261 for (cntr_objects_1 = 0; cntr_objects_1 < r->count; cntr_objects_1++) {
8262 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier2(ndr, NDR_SCALARS, &r->objects[cntr_objects_1]));
8264 for (cntr_objects_1 = 0; cntr_objects_1 < r->count; cntr_objects_1++) {
8265 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier2(ndr, NDR_BUFFERS, &r->objects[cntr_objects_1]));
8267 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_objects_1, 0);
8268 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_objects_0, 0);
8270 if (r->objects) {
8271 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->objects, r->count));
8274 return NDR_ERR_SUCCESS;
8277 _PUBLIC_ void ndr_print_drsuapi_DsAddEntryCtr3(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryCtr3 *r)
8279 uint32_t cntr_objects_1;
8280 ndr_print_struct(ndr, name, "drsuapi_DsAddEntryCtr3");
8281 ndr->depth++;
8282 ndr_print_ptr(ndr, "id", r->id);
8283 ndr->depth++;
8284 if (r->id) {
8285 ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "id", r->id);
8287 ndr->depth--;
8288 ndr_print_uint32(ndr, "level", r->level);
8289 ndr_print_ptr(ndr, "error", r->error);
8290 ndr->depth++;
8291 if (r->error) {
8292 ndr_print_set_switch_value(ndr, r->error, r->level);
8293 ndr_print_drsuapi_DsAddEntryError(ndr, "error", r->error);
8295 ndr->depth--;
8296 ndr_print_uint32(ndr, "count", r->count);
8297 ndr_print_ptr(ndr, "objects", r->objects);
8298 ndr->depth++;
8299 if (r->objects) {
8300 ndr->print(ndr, "%s: ARRAY(%d)", "objects", (int)r->count);
8301 ndr->depth++;
8302 for (cntr_objects_1=0;cntr_objects_1<r->count;cntr_objects_1++) {
8303 char *idx_1=NULL;
8304 if (asprintf(&idx_1, "[%d]", cntr_objects_1) != -1) {
8305 ndr_print_drsuapi_DsReplicaObjectIdentifier2(ndr, "objects", &r->objects[cntr_objects_1]);
8306 free(idx_1);
8309 ndr->depth--;
8311 ndr->depth--;
8312 ndr->depth--;
8315 static enum ndr_err_code ndr_push_drsuapi_DsAddEntryCtr(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsAddEntryCtr *r)
8317 if (ndr_flags & NDR_SCALARS) {
8318 int level = ndr_push_get_switch_value(ndr, r);
8319 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
8320 switch (level) {
8321 case 2: {
8322 NDR_CHECK(ndr_push_drsuapi_DsAddEntryCtr2(ndr, NDR_SCALARS, &r->ctr2));
8323 break; }
8325 case 3: {
8326 NDR_CHECK(ndr_push_drsuapi_DsAddEntryCtr3(ndr, NDR_SCALARS, &r->ctr3));
8327 break; }
8329 default:
8330 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
8333 if (ndr_flags & NDR_BUFFERS) {
8334 int level = ndr_push_get_switch_value(ndr, r);
8335 switch (level) {
8336 case 2:
8337 NDR_CHECK(ndr_push_drsuapi_DsAddEntryCtr2(ndr, NDR_BUFFERS, &r->ctr2));
8338 break;
8340 case 3:
8341 NDR_CHECK(ndr_push_drsuapi_DsAddEntryCtr3(ndr, NDR_BUFFERS, &r->ctr3));
8342 break;
8344 default:
8345 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
8348 return NDR_ERR_SUCCESS;
8351 static enum ndr_err_code ndr_pull_drsuapi_DsAddEntryCtr(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsAddEntryCtr *r)
8353 int level;
8354 int32_t _level;
8355 level = ndr_pull_get_switch_value(ndr, r);
8356 if (ndr_flags & NDR_SCALARS) {
8357 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
8358 if (_level != level) {
8359 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
8361 switch (level) {
8362 case 2: {
8363 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryCtr2(ndr, NDR_SCALARS, &r->ctr2));
8364 break; }
8366 case 3: {
8367 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryCtr3(ndr, NDR_SCALARS, &r->ctr3));
8368 break; }
8370 default:
8371 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
8374 if (ndr_flags & NDR_BUFFERS) {
8375 switch (level) {
8376 case 2:
8377 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryCtr2(ndr, NDR_BUFFERS, &r->ctr2));
8378 break;
8380 case 3:
8381 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryCtr3(ndr, NDR_BUFFERS, &r->ctr3));
8382 break;
8384 default:
8385 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
8388 return NDR_ERR_SUCCESS;
8391 _PUBLIC_ void ndr_print_drsuapi_DsAddEntryCtr(struct ndr_print *ndr, const char *name, const union drsuapi_DsAddEntryCtr *r)
8393 int level;
8394 level = ndr_print_get_switch_value(ndr, r);
8395 ndr_print_union(ndr, name, level, "drsuapi_DsAddEntryCtr");
8396 switch (level) {
8397 case 2:
8398 ndr_print_drsuapi_DsAddEntryCtr2(ndr, "ctr2", &r->ctr2);
8399 break;
8401 case 3:
8402 ndr_print_drsuapi_DsAddEntryCtr3(ndr, "ctr3", &r->ctr3);
8403 break;
8405 default:
8406 ndr_print_bad_level(ndr, name, level);
8410 static enum ndr_err_code ndr_push_drsuapi_DsReplicaGetInfoLevel(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsReplicaGetInfoLevel r)
8412 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
8413 return NDR_ERR_SUCCESS;
8416 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaGetInfoLevel(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsReplicaGetInfoLevel *r)
8418 uint32_t v;
8419 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
8420 *r = v;
8421 return NDR_ERR_SUCCESS;
8424 _PUBLIC_ void ndr_print_drsuapi_DsReplicaGetInfoLevel(struct ndr_print *ndr, const char *name, enum drsuapi_DsReplicaGetInfoLevel r)
8426 const char *val = NULL;
8428 switch (r) {
8429 case DRSUAPI_DS_REPLICA_GET_INFO: val = "DRSUAPI_DS_REPLICA_GET_INFO"; break;
8430 case DRSUAPI_DS_REPLICA_GET_INFO2: val = "DRSUAPI_DS_REPLICA_GET_INFO2"; break;
8432 ndr_print_enum(ndr, name, "ENUM", val, r);
8435 static enum ndr_err_code ndr_push_drsuapi_DsReplicaInfoType(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsReplicaInfoType r)
8437 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
8438 return NDR_ERR_SUCCESS;
8441 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaInfoType(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsReplicaInfoType *r)
8443 uint32_t v;
8444 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
8445 *r = v;
8446 return NDR_ERR_SUCCESS;
8449 _PUBLIC_ void ndr_print_drsuapi_DsReplicaInfoType(struct ndr_print *ndr, const char *name, enum drsuapi_DsReplicaInfoType r)
8451 const char *val = NULL;
8453 switch (r) {
8454 case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS: val = "DRSUAPI_DS_REPLICA_INFO_NEIGHBORS"; break;
8455 case DRSUAPI_DS_REPLICA_INFO_CURSORS: val = "DRSUAPI_DS_REPLICA_INFO_CURSORS"; break;
8456 case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA: val = "DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA"; break;
8457 case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES: val = "DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES"; break;
8458 case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES: val = "DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES"; break;
8459 case DRSUAPI_DS_REPLICA_INFO_PENDING_OPS: val = "DRSUAPI_DS_REPLICA_INFO_PENDING_OPS"; break;
8460 case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA: val = "DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA"; break;
8461 case DRSUAPI_DS_REPLICA_INFO_CURSORS2: val = "DRSUAPI_DS_REPLICA_INFO_CURSORS2"; break;
8462 case DRSUAPI_DS_REPLICA_INFO_CURSORS3: val = "DRSUAPI_DS_REPLICA_INFO_CURSORS3"; break;
8463 case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2: val = "DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2"; break;
8464 case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2: val = "DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2"; break;
8465 case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS02: val = "DRSUAPI_DS_REPLICA_INFO_NEIGHBORS02"; break;
8466 case DRSUAPI_DS_REPLICA_INFO_CONNECTIONS04: val = "DRSUAPI_DS_REPLICA_INFO_CONNECTIONS04"; break;
8467 case DRSUAPI_DS_REPLICA_INFO_CURSORS05: val = "DRSUAPI_DS_REPLICA_INFO_CURSORS05"; break;
8468 case DRSUAPI_DS_REPLICA_INFO_06: val = "DRSUAPI_DS_REPLICA_INFO_06"; break;
8470 ndr_print_enum(ndr, name, "ENUM", val, r);
8473 static enum ndr_err_code ndr_push_drsuapi_DsReplicaGetInfoRequest1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaGetInfoRequest1 *r)
8475 if (ndr_flags & NDR_SCALARS) {
8476 NDR_CHECK(ndr_push_align(ndr, 4));
8477 NDR_CHECK(ndr_push_drsuapi_DsReplicaInfoType(ndr, NDR_SCALARS, r->info_type));
8478 NDR_CHECK(ndr_push_unique_ptr(ndr, r->object_dn));
8479 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->guid1));
8481 if (ndr_flags & NDR_BUFFERS) {
8482 if (r->object_dn) {
8483 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->object_dn, CH_UTF16)));
8484 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
8485 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->object_dn, CH_UTF16)));
8486 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->object_dn, ndr_charset_length(r->object_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16));
8489 return NDR_ERR_SUCCESS;
8492 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaGetInfoRequest1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaGetInfoRequest1 *r)
8494 uint32_t _ptr_object_dn;
8495 TALLOC_CTX *_mem_save_object_dn_0;
8496 if (ndr_flags & NDR_SCALARS) {
8497 NDR_CHECK(ndr_pull_align(ndr, 4));
8498 NDR_CHECK(ndr_pull_drsuapi_DsReplicaInfoType(ndr, NDR_SCALARS, &r->info_type));
8499 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_object_dn));
8500 if (_ptr_object_dn) {
8501 NDR_PULL_ALLOC(ndr, r->object_dn);
8502 } else {
8503 r->object_dn = NULL;
8505 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->guid1));
8507 if (ndr_flags & NDR_BUFFERS) {
8508 if (r->object_dn) {
8509 _mem_save_object_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
8510 NDR_PULL_SET_MEM_CTX(ndr, r->object_dn, 0);
8511 NDR_CHECK(ndr_pull_array_size(ndr, &r->object_dn));
8512 NDR_CHECK(ndr_pull_array_length(ndr, &r->object_dn));
8513 if (ndr_get_array_length(ndr, &r->object_dn) > ndr_get_array_size(ndr, &r->object_dn)) {
8514 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));
8516 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->object_dn), sizeof(uint16_t)));
8517 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->object_dn, ndr_get_array_length(ndr, &r->object_dn), sizeof(uint16_t), CH_UTF16));
8518 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_object_dn_0, 0);
8521 return NDR_ERR_SUCCESS;
8524 _PUBLIC_ void ndr_print_drsuapi_DsReplicaGetInfoRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaGetInfoRequest1 *r)
8526 ndr_print_struct(ndr, name, "drsuapi_DsReplicaGetInfoRequest1");
8527 ndr->depth++;
8528 ndr_print_drsuapi_DsReplicaInfoType(ndr, "info_type", r->info_type);
8529 ndr_print_ptr(ndr, "object_dn", r->object_dn);
8530 ndr->depth++;
8531 if (r->object_dn) {
8532 ndr_print_string(ndr, "object_dn", r->object_dn);
8534 ndr->depth--;
8535 ndr_print_GUID(ndr, "guid1", &r->guid1);
8536 ndr->depth--;
8539 static enum ndr_err_code ndr_push_drsuapi_DsReplicaGetInfoRequest2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaGetInfoRequest2 *r)
8541 if (ndr_flags & NDR_SCALARS) {
8542 NDR_CHECK(ndr_push_align(ndr, 4));
8543 NDR_CHECK(ndr_push_drsuapi_DsReplicaInfoType(ndr, NDR_SCALARS, r->info_type));
8544 NDR_CHECK(ndr_push_unique_ptr(ndr, r->object_dn));
8545 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->guid1));
8546 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1));
8547 NDR_CHECK(ndr_push_unique_ptr(ndr, r->string1));
8548 NDR_CHECK(ndr_push_unique_ptr(ndr, r->string2));
8549 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2));
8551 if (ndr_flags & NDR_BUFFERS) {
8552 if (r->object_dn) {
8553 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->object_dn, CH_UTF16)));
8554 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
8555 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->object_dn, CH_UTF16)));
8556 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->object_dn, ndr_charset_length(r->object_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16));
8558 if (r->string1) {
8559 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->string1, CH_UTF16)));
8560 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
8561 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->string1, CH_UTF16)));
8562 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->string1, ndr_charset_length(r->string1, CH_UTF16), sizeof(uint16_t), CH_UTF16));
8564 if (r->string2) {
8565 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->string2, CH_UTF16)));
8566 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
8567 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->string2, CH_UTF16)));
8568 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->string2, ndr_charset_length(r->string2, CH_UTF16), sizeof(uint16_t), CH_UTF16));
8571 return NDR_ERR_SUCCESS;
8574 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaGetInfoRequest2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaGetInfoRequest2 *r)
8576 uint32_t _ptr_object_dn;
8577 TALLOC_CTX *_mem_save_object_dn_0;
8578 uint32_t _ptr_string1;
8579 TALLOC_CTX *_mem_save_string1_0;
8580 uint32_t _ptr_string2;
8581 TALLOC_CTX *_mem_save_string2_0;
8582 if (ndr_flags & NDR_SCALARS) {
8583 NDR_CHECK(ndr_pull_align(ndr, 4));
8584 NDR_CHECK(ndr_pull_drsuapi_DsReplicaInfoType(ndr, NDR_SCALARS, &r->info_type));
8585 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_object_dn));
8586 if (_ptr_object_dn) {
8587 NDR_PULL_ALLOC(ndr, r->object_dn);
8588 } else {
8589 r->object_dn = NULL;
8591 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->guid1));
8592 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1));
8593 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_string1));
8594 if (_ptr_string1) {
8595 NDR_PULL_ALLOC(ndr, r->string1);
8596 } else {
8597 r->string1 = NULL;
8599 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_string2));
8600 if (_ptr_string2) {
8601 NDR_PULL_ALLOC(ndr, r->string2);
8602 } else {
8603 r->string2 = NULL;
8605 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2));
8607 if (ndr_flags & NDR_BUFFERS) {
8608 if (r->object_dn) {
8609 _mem_save_object_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
8610 NDR_PULL_SET_MEM_CTX(ndr, r->object_dn, 0);
8611 NDR_CHECK(ndr_pull_array_size(ndr, &r->object_dn));
8612 NDR_CHECK(ndr_pull_array_length(ndr, &r->object_dn));
8613 if (ndr_get_array_length(ndr, &r->object_dn) > ndr_get_array_size(ndr, &r->object_dn)) {
8614 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));
8616 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->object_dn), sizeof(uint16_t)));
8617 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->object_dn, ndr_get_array_length(ndr, &r->object_dn), sizeof(uint16_t), CH_UTF16));
8618 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_object_dn_0, 0);
8620 if (r->string1) {
8621 _mem_save_string1_0 = NDR_PULL_GET_MEM_CTX(ndr);
8622 NDR_PULL_SET_MEM_CTX(ndr, r->string1, 0);
8623 NDR_CHECK(ndr_pull_array_size(ndr, &r->string1));
8624 NDR_CHECK(ndr_pull_array_length(ndr, &r->string1));
8625 if (ndr_get_array_length(ndr, &r->string1) > ndr_get_array_size(ndr, &r->string1)) {
8626 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));
8628 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->string1), sizeof(uint16_t)));
8629 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->string1, ndr_get_array_length(ndr, &r->string1), sizeof(uint16_t), CH_UTF16));
8630 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_string1_0, 0);
8632 if (r->string2) {
8633 _mem_save_string2_0 = NDR_PULL_GET_MEM_CTX(ndr);
8634 NDR_PULL_SET_MEM_CTX(ndr, r->string2, 0);
8635 NDR_CHECK(ndr_pull_array_size(ndr, &r->string2));
8636 NDR_CHECK(ndr_pull_array_length(ndr, &r->string2));
8637 if (ndr_get_array_length(ndr, &r->string2) > ndr_get_array_size(ndr, &r->string2)) {
8638 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));
8640 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->string2), sizeof(uint16_t)));
8641 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->string2, ndr_get_array_length(ndr, &r->string2), sizeof(uint16_t), CH_UTF16));
8642 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_string2_0, 0);
8645 return NDR_ERR_SUCCESS;
8648 _PUBLIC_ void ndr_print_drsuapi_DsReplicaGetInfoRequest2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaGetInfoRequest2 *r)
8650 ndr_print_struct(ndr, name, "drsuapi_DsReplicaGetInfoRequest2");
8651 ndr->depth++;
8652 ndr_print_drsuapi_DsReplicaInfoType(ndr, "info_type", r->info_type);
8653 ndr_print_ptr(ndr, "object_dn", r->object_dn);
8654 ndr->depth++;
8655 if (r->object_dn) {
8656 ndr_print_string(ndr, "object_dn", r->object_dn);
8658 ndr->depth--;
8659 ndr_print_GUID(ndr, "guid1", &r->guid1);
8660 ndr_print_uint32(ndr, "unknown1", r->unknown1);
8661 ndr_print_ptr(ndr, "string1", r->string1);
8662 ndr->depth++;
8663 if (r->string1) {
8664 ndr_print_string(ndr, "string1", r->string1);
8666 ndr->depth--;
8667 ndr_print_ptr(ndr, "string2", r->string2);
8668 ndr->depth++;
8669 if (r->string2) {
8670 ndr_print_string(ndr, "string2", r->string2);
8672 ndr->depth--;
8673 ndr_print_uint32(ndr, "unknown2", r->unknown2);
8674 ndr->depth--;
8677 static enum ndr_err_code ndr_push_drsuapi_DsReplicaGetInfoRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsReplicaGetInfoRequest *r)
8679 if (ndr_flags & NDR_SCALARS) {
8680 int level = ndr_push_get_switch_value(ndr, r);
8681 NDR_CHECK(ndr_push_drsuapi_DsReplicaGetInfoLevel(ndr, NDR_SCALARS, level));
8682 switch (level) {
8683 case DRSUAPI_DS_REPLICA_GET_INFO: {
8684 NDR_CHECK(ndr_push_drsuapi_DsReplicaGetInfoRequest1(ndr, NDR_SCALARS, &r->req1));
8685 break; }
8687 case DRSUAPI_DS_REPLICA_GET_INFO2: {
8688 NDR_CHECK(ndr_push_drsuapi_DsReplicaGetInfoRequest2(ndr, NDR_SCALARS, &r->req2));
8689 break; }
8691 default:
8692 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
8695 if (ndr_flags & NDR_BUFFERS) {
8696 int level = ndr_push_get_switch_value(ndr, r);
8697 switch (level) {
8698 case DRSUAPI_DS_REPLICA_GET_INFO:
8699 NDR_CHECK(ndr_push_drsuapi_DsReplicaGetInfoRequest1(ndr, NDR_BUFFERS, &r->req1));
8700 break;
8702 case DRSUAPI_DS_REPLICA_GET_INFO2:
8703 NDR_CHECK(ndr_push_drsuapi_DsReplicaGetInfoRequest2(ndr, NDR_BUFFERS, &r->req2));
8704 break;
8706 default:
8707 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
8710 return NDR_ERR_SUCCESS;
8713 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaGetInfoRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsReplicaGetInfoRequest *r)
8715 int level;
8716 uint32_t _level;
8717 level = ndr_pull_get_switch_value(ndr, r);
8718 if (ndr_flags & NDR_SCALARS) {
8719 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
8720 if (_level != level) {
8721 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
8723 switch (level) {
8724 case DRSUAPI_DS_REPLICA_GET_INFO: {
8725 NDR_CHECK(ndr_pull_drsuapi_DsReplicaGetInfoRequest1(ndr, NDR_SCALARS, &r->req1));
8726 break; }
8728 case DRSUAPI_DS_REPLICA_GET_INFO2: {
8729 NDR_CHECK(ndr_pull_drsuapi_DsReplicaGetInfoRequest2(ndr, NDR_SCALARS, &r->req2));
8730 break; }
8732 default:
8733 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
8736 if (ndr_flags & NDR_BUFFERS) {
8737 switch (level) {
8738 case DRSUAPI_DS_REPLICA_GET_INFO:
8739 NDR_CHECK(ndr_pull_drsuapi_DsReplicaGetInfoRequest1(ndr, NDR_BUFFERS, &r->req1));
8740 break;
8742 case DRSUAPI_DS_REPLICA_GET_INFO2:
8743 NDR_CHECK(ndr_pull_drsuapi_DsReplicaGetInfoRequest2(ndr, NDR_BUFFERS, &r->req2));
8744 break;
8746 default:
8747 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
8750 return NDR_ERR_SUCCESS;
8753 _PUBLIC_ void ndr_print_drsuapi_DsReplicaGetInfoRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsReplicaGetInfoRequest *r)
8755 int level;
8756 level = ndr_print_get_switch_value(ndr, r);
8757 ndr_print_union(ndr, name, level, "drsuapi_DsReplicaGetInfoRequest");
8758 switch (level) {
8759 case DRSUAPI_DS_REPLICA_GET_INFO:
8760 ndr_print_drsuapi_DsReplicaGetInfoRequest1(ndr, "req1", &r->req1);
8761 break;
8763 case DRSUAPI_DS_REPLICA_GET_INFO2:
8764 ndr_print_drsuapi_DsReplicaGetInfoRequest2(ndr, "req2", &r->req2);
8765 break;
8767 default:
8768 ndr_print_bad_level(ndr, name, level);
8772 static enum ndr_err_code ndr_push_drsuapi_DsReplicaNeighbour(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaNeighbour *r)
8774 if (ndr_flags & NDR_SCALARS) {
8775 NDR_CHECK(ndr_push_align(ndr, 8));
8776 NDR_CHECK(ndr_push_unique_ptr(ndr, r->naming_context_dn));
8777 NDR_CHECK(ndr_push_unique_ptr(ndr, r->source_dsa_obj_dn));
8778 NDR_CHECK(ndr_push_unique_ptr(ndr, r->source_dsa_address));
8779 NDR_CHECK(ndr_push_unique_ptr(ndr, r->transport_obj_dn));
8780 NDR_CHECK(ndr_push_drsuapi_DsReplicaNeighbourFlags(ndr, NDR_SCALARS, r->replica_flags));
8781 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved));
8782 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->naming_context_obj_guid));
8783 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_obj_guid));
8784 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
8785 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->transport_obj_guid));
8786 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->tmp_highest_usn));
8787 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->highest_usn));
8788 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_success));
8789 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_attempt));
8790 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->result_last_attempt));
8791 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->consecutive_sync_failures));
8793 if (ndr_flags & NDR_BUFFERS) {
8794 if (r->naming_context_dn) {
8795 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->naming_context_dn, CH_UTF16)));
8796 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
8797 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->naming_context_dn, CH_UTF16)));
8798 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));
8800 if (r->source_dsa_obj_dn) {
8801 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->source_dsa_obj_dn, CH_UTF16)));
8802 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
8803 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->source_dsa_obj_dn, CH_UTF16)));
8804 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));
8806 if (r->source_dsa_address) {
8807 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->source_dsa_address, CH_UTF16)));
8808 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
8809 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->source_dsa_address, CH_UTF16)));
8810 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));
8812 if (r->transport_obj_dn) {
8813 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->transport_obj_dn, CH_UTF16)));
8814 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
8815 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->transport_obj_dn, CH_UTF16)));
8816 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));
8819 return NDR_ERR_SUCCESS;
8822 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaNeighbour(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaNeighbour *r)
8824 uint32_t _ptr_naming_context_dn;
8825 TALLOC_CTX *_mem_save_naming_context_dn_0;
8826 uint32_t _ptr_source_dsa_obj_dn;
8827 TALLOC_CTX *_mem_save_source_dsa_obj_dn_0;
8828 uint32_t _ptr_source_dsa_address;
8829 TALLOC_CTX *_mem_save_source_dsa_address_0;
8830 uint32_t _ptr_transport_obj_dn;
8831 TALLOC_CTX *_mem_save_transport_obj_dn_0;
8832 if (ndr_flags & NDR_SCALARS) {
8833 NDR_CHECK(ndr_pull_align(ndr, 8));
8834 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_naming_context_dn));
8835 if (_ptr_naming_context_dn) {
8836 NDR_PULL_ALLOC(ndr, r->naming_context_dn);
8837 } else {
8838 r->naming_context_dn = NULL;
8840 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_source_dsa_obj_dn));
8841 if (_ptr_source_dsa_obj_dn) {
8842 NDR_PULL_ALLOC(ndr, r->source_dsa_obj_dn);
8843 } else {
8844 r->source_dsa_obj_dn = NULL;
8846 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_source_dsa_address));
8847 if (_ptr_source_dsa_address) {
8848 NDR_PULL_ALLOC(ndr, r->source_dsa_address);
8849 } else {
8850 r->source_dsa_address = NULL;
8852 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_transport_obj_dn));
8853 if (_ptr_transport_obj_dn) {
8854 NDR_PULL_ALLOC(ndr, r->transport_obj_dn);
8855 } else {
8856 r->transport_obj_dn = NULL;
8858 NDR_CHECK(ndr_pull_drsuapi_DsReplicaNeighbourFlags(ndr, NDR_SCALARS, &r->replica_flags));
8859 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved));
8860 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->naming_context_obj_guid));
8861 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_obj_guid));
8862 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
8863 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->transport_obj_guid));
8864 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->tmp_highest_usn));
8865 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->highest_usn));
8866 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_success));
8867 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_attempt));
8868 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->result_last_attempt));
8869 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->consecutive_sync_failures));
8871 if (ndr_flags & NDR_BUFFERS) {
8872 if (r->naming_context_dn) {
8873 _mem_save_naming_context_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
8874 NDR_PULL_SET_MEM_CTX(ndr, r->naming_context_dn, 0);
8875 NDR_CHECK(ndr_pull_array_size(ndr, &r->naming_context_dn));
8876 NDR_CHECK(ndr_pull_array_length(ndr, &r->naming_context_dn));
8877 if (ndr_get_array_length(ndr, &r->naming_context_dn) > ndr_get_array_size(ndr, &r->naming_context_dn)) {
8878 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));
8880 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->naming_context_dn), sizeof(uint16_t)));
8881 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));
8882 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_naming_context_dn_0, 0);
8884 if (r->source_dsa_obj_dn) {
8885 _mem_save_source_dsa_obj_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
8886 NDR_PULL_SET_MEM_CTX(ndr, r->source_dsa_obj_dn, 0);
8887 NDR_CHECK(ndr_pull_array_size(ndr, &r->source_dsa_obj_dn));
8888 NDR_CHECK(ndr_pull_array_length(ndr, &r->source_dsa_obj_dn));
8889 if (ndr_get_array_length(ndr, &r->source_dsa_obj_dn) > ndr_get_array_size(ndr, &r->source_dsa_obj_dn)) {
8890 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));
8892 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->source_dsa_obj_dn), sizeof(uint16_t)));
8893 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));
8894 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_source_dsa_obj_dn_0, 0);
8896 if (r->source_dsa_address) {
8897 _mem_save_source_dsa_address_0 = NDR_PULL_GET_MEM_CTX(ndr);
8898 NDR_PULL_SET_MEM_CTX(ndr, r->source_dsa_address, 0);
8899 NDR_CHECK(ndr_pull_array_size(ndr, &r->source_dsa_address));
8900 NDR_CHECK(ndr_pull_array_length(ndr, &r->source_dsa_address));
8901 if (ndr_get_array_length(ndr, &r->source_dsa_address) > ndr_get_array_size(ndr, &r->source_dsa_address)) {
8902 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));
8904 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->source_dsa_address), sizeof(uint16_t)));
8905 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));
8906 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_source_dsa_address_0, 0);
8908 if (r->transport_obj_dn) {
8909 _mem_save_transport_obj_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
8910 NDR_PULL_SET_MEM_CTX(ndr, r->transport_obj_dn, 0);
8911 NDR_CHECK(ndr_pull_array_size(ndr, &r->transport_obj_dn));
8912 NDR_CHECK(ndr_pull_array_length(ndr, &r->transport_obj_dn));
8913 if (ndr_get_array_length(ndr, &r->transport_obj_dn) > ndr_get_array_size(ndr, &r->transport_obj_dn)) {
8914 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));
8916 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->transport_obj_dn), sizeof(uint16_t)));
8917 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));
8918 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_transport_obj_dn_0, 0);
8921 return NDR_ERR_SUCCESS;
8924 _PUBLIC_ void ndr_print_drsuapi_DsReplicaNeighbour(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaNeighbour *r)
8926 ndr_print_struct(ndr, name, "drsuapi_DsReplicaNeighbour");
8927 ndr->depth++;
8928 ndr_print_ptr(ndr, "naming_context_dn", r->naming_context_dn);
8929 ndr->depth++;
8930 if (r->naming_context_dn) {
8931 ndr_print_string(ndr, "naming_context_dn", r->naming_context_dn);
8933 ndr->depth--;
8934 ndr_print_ptr(ndr, "source_dsa_obj_dn", r->source_dsa_obj_dn);
8935 ndr->depth++;
8936 if (r->source_dsa_obj_dn) {
8937 ndr_print_string(ndr, "source_dsa_obj_dn", r->source_dsa_obj_dn);
8939 ndr->depth--;
8940 ndr_print_ptr(ndr, "source_dsa_address", r->source_dsa_address);
8941 ndr->depth++;
8942 if (r->source_dsa_address) {
8943 ndr_print_string(ndr, "source_dsa_address", r->source_dsa_address);
8945 ndr->depth--;
8946 ndr_print_ptr(ndr, "transport_obj_dn", r->transport_obj_dn);
8947 ndr->depth++;
8948 if (r->transport_obj_dn) {
8949 ndr_print_string(ndr, "transport_obj_dn", r->transport_obj_dn);
8951 ndr->depth--;
8952 ndr_print_drsuapi_DsReplicaNeighbourFlags(ndr, "replica_flags", r->replica_flags);
8953 ndr_print_uint32(ndr, "reserved", r->reserved);
8954 ndr_print_GUID(ndr, "naming_context_obj_guid", &r->naming_context_obj_guid);
8955 ndr_print_GUID(ndr, "source_dsa_obj_guid", &r->source_dsa_obj_guid);
8956 ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id);
8957 ndr_print_GUID(ndr, "transport_obj_guid", &r->transport_obj_guid);
8958 ndr_print_hyper(ndr, "tmp_highest_usn", r->tmp_highest_usn);
8959 ndr_print_hyper(ndr, "highest_usn", r->highest_usn);
8960 ndr_print_NTTIME(ndr, "last_success", r->last_success);
8961 ndr_print_NTTIME(ndr, "last_attempt", r->last_attempt);
8962 ndr_print_WERROR(ndr, "result_last_attempt", r->result_last_attempt);
8963 ndr_print_uint32(ndr, "consecutive_sync_failures", r->consecutive_sync_failures);
8964 ndr->depth--;
8967 static enum ndr_err_code ndr_push_drsuapi_DsReplicaNeighbourCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaNeighbourCtr *r)
8969 uint32_t cntr_array_0;
8970 if (ndr_flags & NDR_SCALARS) {
8971 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
8972 NDR_CHECK(ndr_push_align(ndr, 8));
8973 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
8974 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved));
8975 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
8976 NDR_CHECK(ndr_push_drsuapi_DsReplicaNeighbour(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
8979 if (ndr_flags & NDR_BUFFERS) {
8980 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
8981 NDR_CHECK(ndr_push_drsuapi_DsReplicaNeighbour(ndr, NDR_BUFFERS, &r->array[cntr_array_0]));
8984 return NDR_ERR_SUCCESS;
8987 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaNeighbourCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaNeighbourCtr *r)
8989 uint32_t cntr_array_0;
8990 TALLOC_CTX *_mem_save_array_0;
8991 if (ndr_flags & NDR_SCALARS) {
8992 NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
8993 NDR_CHECK(ndr_pull_align(ndr, 8));
8994 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
8995 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved));
8996 NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
8997 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
8998 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
8999 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
9000 NDR_CHECK(ndr_pull_drsuapi_DsReplicaNeighbour(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
9002 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
9003 if (r->array) {
9004 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
9007 if (ndr_flags & NDR_BUFFERS) {
9008 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
9009 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
9010 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
9011 NDR_CHECK(ndr_pull_drsuapi_DsReplicaNeighbour(ndr, NDR_BUFFERS, &r->array[cntr_array_0]));
9013 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
9015 return NDR_ERR_SUCCESS;
9018 _PUBLIC_ void ndr_print_drsuapi_DsReplicaNeighbourCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaNeighbourCtr *r)
9020 uint32_t cntr_array_0;
9021 ndr_print_struct(ndr, name, "drsuapi_DsReplicaNeighbourCtr");
9022 ndr->depth++;
9023 ndr_print_uint32(ndr, "count", r->count);
9024 ndr_print_uint32(ndr, "reserved", r->reserved);
9025 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
9026 ndr->depth++;
9027 for (cntr_array_0=0;cntr_array_0<r->count;cntr_array_0++) {
9028 char *idx_0=NULL;
9029 if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) {
9030 ndr_print_drsuapi_DsReplicaNeighbour(ndr, "array", &r->array[cntr_array_0]);
9031 free(idx_0);
9034 ndr->depth--;
9035 ndr->depth--;
9038 static enum ndr_err_code ndr_push_drsuapi_DsReplicaCursorCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursorCtr *r)
9040 uint32_t cntr_array_0;
9041 if (ndr_flags & NDR_SCALARS) {
9042 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
9043 NDR_CHECK(ndr_push_align(ndr, 8));
9044 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
9045 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved));
9046 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
9047 NDR_CHECK(ndr_push_drsuapi_DsReplicaCursor(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
9050 if (ndr_flags & NDR_BUFFERS) {
9052 return NDR_ERR_SUCCESS;
9055 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursorCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursorCtr *r)
9057 uint32_t cntr_array_0;
9058 TALLOC_CTX *_mem_save_array_0;
9059 if (ndr_flags & NDR_SCALARS) {
9060 NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
9061 NDR_CHECK(ndr_pull_align(ndr, 8));
9062 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
9063 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved));
9064 NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
9065 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
9066 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
9067 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
9068 NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursor(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
9070 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
9071 if (r->array) {
9072 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
9075 if (ndr_flags & NDR_BUFFERS) {
9077 return NDR_ERR_SUCCESS;
9080 _PUBLIC_ void ndr_print_drsuapi_DsReplicaCursorCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursorCtr *r)
9082 uint32_t cntr_array_0;
9083 ndr_print_struct(ndr, name, "drsuapi_DsReplicaCursorCtr");
9084 ndr->depth++;
9085 ndr_print_uint32(ndr, "count", r->count);
9086 ndr_print_uint32(ndr, "reserved", r->reserved);
9087 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
9088 ndr->depth++;
9089 for (cntr_array_0=0;cntr_array_0<r->count;cntr_array_0++) {
9090 char *idx_0=NULL;
9091 if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) {
9092 ndr_print_drsuapi_DsReplicaCursor(ndr, "array", &r->array[cntr_array_0]);
9093 free(idx_0);
9096 ndr->depth--;
9097 ndr->depth--;
9100 static enum ndr_err_code ndr_push_drsuapi_DsReplicaObjMetaData(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjMetaData *r)
9102 if (ndr_flags & NDR_SCALARS) {
9103 NDR_CHECK(ndr_push_align(ndr, 8));
9104 NDR_CHECK(ndr_push_unique_ptr(ndr, r->attribute_name));
9105 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version));
9106 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->originating_change_time));
9107 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id));
9108 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->originating_usn));
9109 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->local_usn));
9111 if (ndr_flags & NDR_BUFFERS) {
9112 if (r->attribute_name) {
9113 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->attribute_name, CH_UTF16)));
9114 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
9115 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->attribute_name, CH_UTF16)));
9116 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->attribute_name, ndr_charset_length(r->attribute_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
9119 return NDR_ERR_SUCCESS;
9122 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjMetaData(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjMetaData *r)
9124 uint32_t _ptr_attribute_name;
9125 TALLOC_CTX *_mem_save_attribute_name_0;
9126 if (ndr_flags & NDR_SCALARS) {
9127 NDR_CHECK(ndr_pull_align(ndr, 8));
9128 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_attribute_name));
9129 if (_ptr_attribute_name) {
9130 NDR_PULL_ALLOC(ndr, r->attribute_name);
9131 } else {
9132 r->attribute_name = NULL;
9134 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
9135 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->originating_change_time));
9136 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id));
9137 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->originating_usn));
9138 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->local_usn));
9140 if (ndr_flags & NDR_BUFFERS) {
9141 if (r->attribute_name) {
9142 _mem_save_attribute_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
9143 NDR_PULL_SET_MEM_CTX(ndr, r->attribute_name, 0);
9144 NDR_CHECK(ndr_pull_array_size(ndr, &r->attribute_name));
9145 NDR_CHECK(ndr_pull_array_length(ndr, &r->attribute_name));
9146 if (ndr_get_array_length(ndr, &r->attribute_name) > ndr_get_array_size(ndr, &r->attribute_name)) {
9147 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));
9149 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->attribute_name), sizeof(uint16_t)));
9150 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->attribute_name, ndr_get_array_length(ndr, &r->attribute_name), sizeof(uint16_t), CH_UTF16));
9151 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attribute_name_0, 0);
9154 return NDR_ERR_SUCCESS;
9157 _PUBLIC_ void ndr_print_drsuapi_DsReplicaObjMetaData(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjMetaData *r)
9159 ndr_print_struct(ndr, name, "drsuapi_DsReplicaObjMetaData");
9160 ndr->depth++;
9161 ndr_print_ptr(ndr, "attribute_name", r->attribute_name);
9162 ndr->depth++;
9163 if (r->attribute_name) {
9164 ndr_print_string(ndr, "attribute_name", r->attribute_name);
9166 ndr->depth--;
9167 ndr_print_uint32(ndr, "version", r->version);
9168 ndr_print_NTTIME(ndr, "originating_change_time", r->originating_change_time);
9169 ndr_print_GUID(ndr, "originating_invocation_id", &r->originating_invocation_id);
9170 ndr_print_hyper(ndr, "originating_usn", r->originating_usn);
9171 ndr_print_hyper(ndr, "local_usn", r->local_usn);
9172 ndr->depth--;
9175 static enum ndr_err_code ndr_push_drsuapi_DsReplicaObjMetaDataCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjMetaDataCtr *r)
9177 uint32_t cntr_array_0;
9178 if (ndr_flags & NDR_SCALARS) {
9179 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
9180 NDR_CHECK(ndr_push_align(ndr, 8));
9181 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
9182 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved));
9183 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
9184 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjMetaData(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
9187 if (ndr_flags & NDR_BUFFERS) {
9188 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
9189 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjMetaData(ndr, NDR_BUFFERS, &r->array[cntr_array_0]));
9192 return NDR_ERR_SUCCESS;
9195 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjMetaDataCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjMetaDataCtr *r)
9197 uint32_t cntr_array_0;
9198 TALLOC_CTX *_mem_save_array_0;
9199 if (ndr_flags & NDR_SCALARS) {
9200 NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
9201 NDR_CHECK(ndr_pull_align(ndr, 8));
9202 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
9203 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved));
9204 NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
9205 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
9206 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
9207 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
9208 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjMetaData(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
9210 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
9211 if (r->array) {
9212 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
9215 if (ndr_flags & NDR_BUFFERS) {
9216 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
9217 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
9218 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
9219 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjMetaData(ndr, NDR_BUFFERS, &r->array[cntr_array_0]));
9221 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
9223 return NDR_ERR_SUCCESS;
9226 _PUBLIC_ void ndr_print_drsuapi_DsReplicaObjMetaDataCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjMetaDataCtr *r)
9228 uint32_t cntr_array_0;
9229 ndr_print_struct(ndr, name, "drsuapi_DsReplicaObjMetaDataCtr");
9230 ndr->depth++;
9231 ndr_print_uint32(ndr, "count", r->count);
9232 ndr_print_uint32(ndr, "reserved", r->reserved);
9233 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
9234 ndr->depth++;
9235 for (cntr_array_0=0;cntr_array_0<r->count;cntr_array_0++) {
9236 char *idx_0=NULL;
9237 if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) {
9238 ndr_print_drsuapi_DsReplicaObjMetaData(ndr, "array", &r->array[cntr_array_0]);
9239 free(idx_0);
9242 ndr->depth--;
9243 ndr->depth--;
9246 static enum ndr_err_code ndr_push_drsuapi_DsReplicaKccDsaFailure(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaKccDsaFailure *r)
9248 if (ndr_flags & NDR_SCALARS) {
9249 NDR_CHECK(ndr_push_align(ndr, 4));
9250 NDR_CHECK(ndr_push_unique_ptr(ndr, r->dsa_obj_dn));
9251 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->dsa_obj_guid));
9252 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->first_failure));
9253 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_failures));
9254 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->last_result));
9256 if (ndr_flags & NDR_BUFFERS) {
9257 if (r->dsa_obj_dn) {
9258 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dsa_obj_dn, CH_UTF16)));
9259 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
9260 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dsa_obj_dn, CH_UTF16)));
9261 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));
9264 return NDR_ERR_SUCCESS;
9267 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaKccDsaFailure(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaKccDsaFailure *r)
9269 uint32_t _ptr_dsa_obj_dn;
9270 TALLOC_CTX *_mem_save_dsa_obj_dn_0;
9271 if (ndr_flags & NDR_SCALARS) {
9272 NDR_CHECK(ndr_pull_align(ndr, 4));
9273 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dsa_obj_dn));
9274 if (_ptr_dsa_obj_dn) {
9275 NDR_PULL_ALLOC(ndr, r->dsa_obj_dn);
9276 } else {
9277 r->dsa_obj_dn = NULL;
9279 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->dsa_obj_guid));
9280 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->first_failure));
9281 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_failures));
9282 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->last_result));
9284 if (ndr_flags & NDR_BUFFERS) {
9285 if (r->dsa_obj_dn) {
9286 _mem_save_dsa_obj_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
9287 NDR_PULL_SET_MEM_CTX(ndr, r->dsa_obj_dn, 0);
9288 NDR_CHECK(ndr_pull_array_size(ndr, &r->dsa_obj_dn));
9289 NDR_CHECK(ndr_pull_array_length(ndr, &r->dsa_obj_dn));
9290 if (ndr_get_array_length(ndr, &r->dsa_obj_dn) > ndr_get_array_size(ndr, &r->dsa_obj_dn)) {
9291 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));
9293 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dsa_obj_dn), sizeof(uint16_t)));
9294 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));
9295 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dsa_obj_dn_0, 0);
9298 return NDR_ERR_SUCCESS;
9301 _PUBLIC_ void ndr_print_drsuapi_DsReplicaKccDsaFailure(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaKccDsaFailure *r)
9303 ndr_print_struct(ndr, name, "drsuapi_DsReplicaKccDsaFailure");
9304 ndr->depth++;
9305 ndr_print_ptr(ndr, "dsa_obj_dn", r->dsa_obj_dn);
9306 ndr->depth++;
9307 if (r->dsa_obj_dn) {
9308 ndr_print_string(ndr, "dsa_obj_dn", r->dsa_obj_dn);
9310 ndr->depth--;
9311 ndr_print_GUID(ndr, "dsa_obj_guid", &r->dsa_obj_guid);
9312 ndr_print_NTTIME(ndr, "first_failure", r->first_failure);
9313 ndr_print_uint32(ndr, "num_failures", r->num_failures);
9314 ndr_print_WERROR(ndr, "last_result", r->last_result);
9315 ndr->depth--;
9318 static enum ndr_err_code ndr_push_drsuapi_DsReplicaKccDsaFailuresCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaKccDsaFailuresCtr *r)
9320 uint32_t cntr_array_0;
9321 if (ndr_flags & NDR_SCALARS) {
9322 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
9323 NDR_CHECK(ndr_push_align(ndr, 4));
9324 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
9325 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved));
9326 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
9327 NDR_CHECK(ndr_push_drsuapi_DsReplicaKccDsaFailure(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
9330 if (ndr_flags & NDR_BUFFERS) {
9331 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
9332 NDR_CHECK(ndr_push_drsuapi_DsReplicaKccDsaFailure(ndr, NDR_BUFFERS, &r->array[cntr_array_0]));
9335 return NDR_ERR_SUCCESS;
9338 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaKccDsaFailuresCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaKccDsaFailuresCtr *r)
9340 uint32_t cntr_array_0;
9341 TALLOC_CTX *_mem_save_array_0;
9342 if (ndr_flags & NDR_SCALARS) {
9343 NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
9344 NDR_CHECK(ndr_pull_align(ndr, 4));
9345 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
9346 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved));
9347 NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
9348 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
9349 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
9350 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
9351 NDR_CHECK(ndr_pull_drsuapi_DsReplicaKccDsaFailure(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
9353 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
9354 if (r->array) {
9355 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
9358 if (ndr_flags & NDR_BUFFERS) {
9359 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
9360 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
9361 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
9362 NDR_CHECK(ndr_pull_drsuapi_DsReplicaKccDsaFailure(ndr, NDR_BUFFERS, &r->array[cntr_array_0]));
9364 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
9366 return NDR_ERR_SUCCESS;
9369 _PUBLIC_ void ndr_print_drsuapi_DsReplicaKccDsaFailuresCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaKccDsaFailuresCtr *r)
9371 uint32_t cntr_array_0;
9372 ndr_print_struct(ndr, name, "drsuapi_DsReplicaKccDsaFailuresCtr");
9373 ndr->depth++;
9374 ndr_print_uint32(ndr, "count", r->count);
9375 ndr_print_uint32(ndr, "reserved", r->reserved);
9376 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
9377 ndr->depth++;
9378 for (cntr_array_0=0;cntr_array_0<r->count;cntr_array_0++) {
9379 char *idx_0=NULL;
9380 if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) {
9381 ndr_print_drsuapi_DsReplicaKccDsaFailure(ndr, "array", &r->array[cntr_array_0]);
9382 free(idx_0);
9385 ndr->depth--;
9386 ndr->depth--;
9389 static enum ndr_err_code ndr_push_drsuapi_DsReplicaOpType(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsReplicaOpType r)
9391 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r));
9392 return NDR_ERR_SUCCESS;
9395 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaOpType(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsReplicaOpType *r)
9397 uint16_t v;
9398 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v));
9399 *r = v;
9400 return NDR_ERR_SUCCESS;
9403 _PUBLIC_ void ndr_print_drsuapi_DsReplicaOpType(struct ndr_print *ndr, const char *name, enum drsuapi_DsReplicaOpType r)
9405 const char *val = NULL;
9407 switch (r) {
9408 case DRSUAPI_DS_REPLICA_OP_TYPE_SYNC: val = "DRSUAPI_DS_REPLICA_OP_TYPE_SYNC"; break;
9409 case DRSUAPI_DS_REPLICA_OP_TYPE_ADD: val = "DRSUAPI_DS_REPLICA_OP_TYPE_ADD"; break;
9410 case DRSUAPI_DS_REPLICA_OP_TYPE_DELETE: val = "DRSUAPI_DS_REPLICA_OP_TYPE_DELETE"; break;
9411 case DRSUAPI_DS_REPLICA_OP_TYPE_MODIFY: val = "DRSUAPI_DS_REPLICA_OP_TYPE_MODIFY"; break;
9412 case DRSUAPI_DS_REPLICA_OP_TYPE_UPDATE_REFS: val = "DRSUAPI_DS_REPLICA_OP_TYPE_UPDATE_REFS"; break;
9414 ndr_print_enum(ndr, name, "ENUM", val, r);
9417 static enum ndr_err_code ndr_push_drsuapi_DsRplicaOpOptions(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsRplicaOpOptions *r)
9419 if (ndr_flags & NDR_SCALARS) {
9420 int level = ndr_push_get_switch_value(ndr, r);
9421 NDR_CHECK(ndr_push_drsuapi_DsReplicaOpType(ndr, NDR_SCALARS, level));
9422 switch (level) {
9423 case DRSUAPI_DS_REPLICA_OP_TYPE_SYNC: {
9424 NDR_CHECK(ndr_push_drsuapi_DsReplicaSyncOptions(ndr, NDR_SCALARS, r->sync));
9425 break; }
9427 case DRSUAPI_DS_REPLICA_OP_TYPE_ADD: {
9428 NDR_CHECK(ndr_push_drsuapi_DsReplicaAddOptions(ndr, NDR_SCALARS, r->add));
9429 break; }
9431 case DRSUAPI_DS_REPLICA_OP_TYPE_DELETE: {
9432 NDR_CHECK(ndr_push_drsuapi_DsReplicaDeleteOptions(ndr, NDR_SCALARS, r->op_delete));
9433 break; }
9435 case DRSUAPI_DS_REPLICA_OP_TYPE_MODIFY: {
9436 NDR_CHECK(ndr_push_drsuapi_DsReplicaModifyOptions(ndr, NDR_SCALARS, r->modify));
9437 break; }
9439 case DRSUAPI_DS_REPLICA_OP_TYPE_UPDATE_REFS: {
9440 NDR_CHECK(ndr_push_drsuapi_DsReplicaUpdateRefsOptions(ndr, NDR_SCALARS, r->update_refs));
9441 break; }
9443 default: {
9444 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown));
9445 break; }
9449 if (ndr_flags & NDR_BUFFERS) {
9450 int level = ndr_push_get_switch_value(ndr, r);
9451 switch (level) {
9452 case DRSUAPI_DS_REPLICA_OP_TYPE_SYNC:
9453 break;
9455 case DRSUAPI_DS_REPLICA_OP_TYPE_ADD:
9456 break;
9458 case DRSUAPI_DS_REPLICA_OP_TYPE_DELETE:
9459 break;
9461 case DRSUAPI_DS_REPLICA_OP_TYPE_MODIFY:
9462 break;
9464 case DRSUAPI_DS_REPLICA_OP_TYPE_UPDATE_REFS:
9465 break;
9467 default:
9468 break;
9472 return NDR_ERR_SUCCESS;
9475 static enum ndr_err_code ndr_pull_drsuapi_DsRplicaOpOptions(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsRplicaOpOptions *r)
9477 int level;
9478 uint16_t _level;
9479 level = ndr_pull_get_switch_value(ndr, r);
9480 if (ndr_flags & NDR_SCALARS) {
9481 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level));
9482 if (_level != level) {
9483 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
9485 switch (level) {
9486 case DRSUAPI_DS_REPLICA_OP_TYPE_SYNC: {
9487 NDR_CHECK(ndr_pull_drsuapi_DsReplicaSyncOptions(ndr, NDR_SCALARS, &r->sync));
9488 break; }
9490 case DRSUAPI_DS_REPLICA_OP_TYPE_ADD: {
9491 NDR_CHECK(ndr_pull_drsuapi_DsReplicaAddOptions(ndr, NDR_SCALARS, &r->add));
9492 break; }
9494 case DRSUAPI_DS_REPLICA_OP_TYPE_DELETE: {
9495 NDR_CHECK(ndr_pull_drsuapi_DsReplicaDeleteOptions(ndr, NDR_SCALARS, &r->op_delete));
9496 break; }
9498 case DRSUAPI_DS_REPLICA_OP_TYPE_MODIFY: {
9499 NDR_CHECK(ndr_pull_drsuapi_DsReplicaModifyOptions(ndr, NDR_SCALARS, &r->modify));
9500 break; }
9502 case DRSUAPI_DS_REPLICA_OP_TYPE_UPDATE_REFS: {
9503 NDR_CHECK(ndr_pull_drsuapi_DsReplicaUpdateRefsOptions(ndr, NDR_SCALARS, &r->update_refs));
9504 break; }
9506 default: {
9507 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown));
9508 break; }
9512 if (ndr_flags & NDR_BUFFERS) {
9513 switch (level) {
9514 case DRSUAPI_DS_REPLICA_OP_TYPE_SYNC:
9515 break;
9517 case DRSUAPI_DS_REPLICA_OP_TYPE_ADD:
9518 break;
9520 case DRSUAPI_DS_REPLICA_OP_TYPE_DELETE:
9521 break;
9523 case DRSUAPI_DS_REPLICA_OP_TYPE_MODIFY:
9524 break;
9526 case DRSUAPI_DS_REPLICA_OP_TYPE_UPDATE_REFS:
9527 break;
9529 default:
9530 break;
9534 return NDR_ERR_SUCCESS;
9537 _PUBLIC_ void ndr_print_drsuapi_DsRplicaOpOptions(struct ndr_print *ndr, const char *name, const union drsuapi_DsRplicaOpOptions *r)
9539 int level;
9540 level = ndr_print_get_switch_value(ndr, r);
9541 ndr_print_union(ndr, name, level, "drsuapi_DsRplicaOpOptions");
9542 switch (level) {
9543 case DRSUAPI_DS_REPLICA_OP_TYPE_SYNC:
9544 ndr_print_drsuapi_DsReplicaSyncOptions(ndr, "sync", r->sync);
9545 break;
9547 case DRSUAPI_DS_REPLICA_OP_TYPE_ADD:
9548 ndr_print_drsuapi_DsReplicaAddOptions(ndr, "add", r->add);
9549 break;
9551 case DRSUAPI_DS_REPLICA_OP_TYPE_DELETE:
9552 ndr_print_drsuapi_DsReplicaDeleteOptions(ndr, "op_delete", r->op_delete);
9553 break;
9555 case DRSUAPI_DS_REPLICA_OP_TYPE_MODIFY:
9556 ndr_print_drsuapi_DsReplicaModifyOptions(ndr, "modify", r->modify);
9557 break;
9559 case DRSUAPI_DS_REPLICA_OP_TYPE_UPDATE_REFS:
9560 ndr_print_drsuapi_DsReplicaUpdateRefsOptions(ndr, "update_refs", r->update_refs);
9561 break;
9563 default:
9564 ndr_print_uint32(ndr, "unknown", r->unknown);
9565 break;
9570 static enum ndr_err_code ndr_push_drsuapi_DsReplicaOp(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaOp *r)
9572 if (ndr_flags & NDR_SCALARS) {
9573 NDR_CHECK(ndr_push_align(ndr, 4));
9574 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->operation_start));
9575 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->serial_num));
9576 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->priority));
9577 NDR_CHECK(ndr_push_drsuapi_DsReplicaOpType(ndr, NDR_SCALARS, r->operation_type));
9578 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->options, r->operation_type));
9579 NDR_CHECK(ndr_push_drsuapi_DsRplicaOpOptions(ndr, NDR_SCALARS, &r->options));
9580 NDR_CHECK(ndr_push_unique_ptr(ndr, r->nc_dn));
9581 NDR_CHECK(ndr_push_unique_ptr(ndr, r->remote_dsa_obj_dn));
9582 NDR_CHECK(ndr_push_unique_ptr(ndr, r->remote_dsa_address));
9583 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->nc_obj_guid));
9584 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->remote_dsa_obj_guid));
9586 if (ndr_flags & NDR_BUFFERS) {
9587 if (r->nc_dn) {
9588 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->nc_dn, CH_UTF16)));
9589 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
9590 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->nc_dn, CH_UTF16)));
9591 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->nc_dn, ndr_charset_length(r->nc_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16));
9593 if (r->remote_dsa_obj_dn) {
9594 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->remote_dsa_obj_dn, CH_UTF16)));
9595 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
9596 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->remote_dsa_obj_dn, CH_UTF16)));
9597 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));
9599 if (r->remote_dsa_address) {
9600 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->remote_dsa_address, CH_UTF16)));
9601 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
9602 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->remote_dsa_address, CH_UTF16)));
9603 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));
9606 return NDR_ERR_SUCCESS;
9609 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaOp(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaOp *r)
9611 uint32_t _ptr_nc_dn;
9612 TALLOC_CTX *_mem_save_nc_dn_0;
9613 uint32_t _ptr_remote_dsa_obj_dn;
9614 TALLOC_CTX *_mem_save_remote_dsa_obj_dn_0;
9615 uint32_t _ptr_remote_dsa_address;
9616 TALLOC_CTX *_mem_save_remote_dsa_address_0;
9617 if (ndr_flags & NDR_SCALARS) {
9618 NDR_CHECK(ndr_pull_align(ndr, 4));
9619 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->operation_start));
9620 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->serial_num));
9621 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->priority));
9622 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOpType(ndr, NDR_SCALARS, &r->operation_type));
9623 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->options, r->operation_type));
9624 NDR_CHECK(ndr_pull_drsuapi_DsRplicaOpOptions(ndr, NDR_SCALARS, &r->options));
9625 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_nc_dn));
9626 if (_ptr_nc_dn) {
9627 NDR_PULL_ALLOC(ndr, r->nc_dn);
9628 } else {
9629 r->nc_dn = NULL;
9631 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_remote_dsa_obj_dn));
9632 if (_ptr_remote_dsa_obj_dn) {
9633 NDR_PULL_ALLOC(ndr, r->remote_dsa_obj_dn);
9634 } else {
9635 r->remote_dsa_obj_dn = NULL;
9637 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_remote_dsa_address));
9638 if (_ptr_remote_dsa_address) {
9639 NDR_PULL_ALLOC(ndr, r->remote_dsa_address);
9640 } else {
9641 r->remote_dsa_address = NULL;
9643 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->nc_obj_guid));
9644 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->remote_dsa_obj_guid));
9646 if (ndr_flags & NDR_BUFFERS) {
9647 if (r->nc_dn) {
9648 _mem_save_nc_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
9649 NDR_PULL_SET_MEM_CTX(ndr, r->nc_dn, 0);
9650 NDR_CHECK(ndr_pull_array_size(ndr, &r->nc_dn));
9651 NDR_CHECK(ndr_pull_array_length(ndr, &r->nc_dn));
9652 if (ndr_get_array_length(ndr, &r->nc_dn) > ndr_get_array_size(ndr, &r->nc_dn)) {
9653 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));
9655 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->nc_dn), sizeof(uint16_t)));
9656 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->nc_dn, ndr_get_array_length(ndr, &r->nc_dn), sizeof(uint16_t), CH_UTF16));
9657 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_nc_dn_0, 0);
9659 if (r->remote_dsa_obj_dn) {
9660 _mem_save_remote_dsa_obj_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
9661 NDR_PULL_SET_MEM_CTX(ndr, r->remote_dsa_obj_dn, 0);
9662 NDR_CHECK(ndr_pull_array_size(ndr, &r->remote_dsa_obj_dn));
9663 NDR_CHECK(ndr_pull_array_length(ndr, &r->remote_dsa_obj_dn));
9664 if (ndr_get_array_length(ndr, &r->remote_dsa_obj_dn) > ndr_get_array_size(ndr, &r->remote_dsa_obj_dn)) {
9665 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));
9667 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->remote_dsa_obj_dn), sizeof(uint16_t)));
9668 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));
9669 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_remote_dsa_obj_dn_0, 0);
9671 if (r->remote_dsa_address) {
9672 _mem_save_remote_dsa_address_0 = NDR_PULL_GET_MEM_CTX(ndr);
9673 NDR_PULL_SET_MEM_CTX(ndr, r->remote_dsa_address, 0);
9674 NDR_CHECK(ndr_pull_array_size(ndr, &r->remote_dsa_address));
9675 NDR_CHECK(ndr_pull_array_length(ndr, &r->remote_dsa_address));
9676 if (ndr_get_array_length(ndr, &r->remote_dsa_address) > ndr_get_array_size(ndr, &r->remote_dsa_address)) {
9677 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));
9679 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->remote_dsa_address), sizeof(uint16_t)));
9680 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));
9681 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_remote_dsa_address_0, 0);
9684 return NDR_ERR_SUCCESS;
9687 _PUBLIC_ void ndr_print_drsuapi_DsReplicaOp(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaOp *r)
9689 ndr_print_struct(ndr, name, "drsuapi_DsReplicaOp");
9690 ndr->depth++;
9691 ndr_print_NTTIME(ndr, "operation_start", r->operation_start);
9692 ndr_print_uint32(ndr, "serial_num", r->serial_num);
9693 ndr_print_uint32(ndr, "priority", r->priority);
9694 ndr_print_drsuapi_DsReplicaOpType(ndr, "operation_type", r->operation_type);
9695 ndr_print_set_switch_value(ndr, &r->options, r->operation_type);
9696 ndr_print_drsuapi_DsRplicaOpOptions(ndr, "options", &r->options);
9697 ndr_print_ptr(ndr, "nc_dn", r->nc_dn);
9698 ndr->depth++;
9699 if (r->nc_dn) {
9700 ndr_print_string(ndr, "nc_dn", r->nc_dn);
9702 ndr->depth--;
9703 ndr_print_ptr(ndr, "remote_dsa_obj_dn", r->remote_dsa_obj_dn);
9704 ndr->depth++;
9705 if (r->remote_dsa_obj_dn) {
9706 ndr_print_string(ndr, "remote_dsa_obj_dn", r->remote_dsa_obj_dn);
9708 ndr->depth--;
9709 ndr_print_ptr(ndr, "remote_dsa_address", r->remote_dsa_address);
9710 ndr->depth++;
9711 if (r->remote_dsa_address) {
9712 ndr_print_string(ndr, "remote_dsa_address", r->remote_dsa_address);
9714 ndr->depth--;
9715 ndr_print_GUID(ndr, "nc_obj_guid", &r->nc_obj_guid);
9716 ndr_print_GUID(ndr, "remote_dsa_obj_guid", &r->remote_dsa_obj_guid);
9717 ndr->depth--;
9720 static enum ndr_err_code ndr_push_drsuapi_DsReplicaOpCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaOpCtr *r)
9722 uint32_t cntr_array_0;
9723 if (ndr_flags & NDR_SCALARS) {
9724 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
9725 NDR_CHECK(ndr_push_align(ndr, 4));
9726 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->time));
9727 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
9728 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
9729 NDR_CHECK(ndr_push_drsuapi_DsReplicaOp(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
9732 if (ndr_flags & NDR_BUFFERS) {
9733 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
9734 NDR_CHECK(ndr_push_drsuapi_DsReplicaOp(ndr, NDR_BUFFERS, &r->array[cntr_array_0]));
9737 return NDR_ERR_SUCCESS;
9740 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaOpCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaOpCtr *r)
9742 uint32_t cntr_array_0;
9743 TALLOC_CTX *_mem_save_array_0;
9744 if (ndr_flags & NDR_SCALARS) {
9745 NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
9746 NDR_CHECK(ndr_pull_align(ndr, 4));
9747 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->time));
9748 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
9749 NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
9750 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
9751 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
9752 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
9753 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOp(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
9755 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
9756 if (r->array) {
9757 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
9760 if (ndr_flags & NDR_BUFFERS) {
9761 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
9762 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
9763 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
9764 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOp(ndr, NDR_BUFFERS, &r->array[cntr_array_0]));
9766 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
9768 return NDR_ERR_SUCCESS;
9771 _PUBLIC_ void ndr_print_drsuapi_DsReplicaOpCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaOpCtr *r)
9773 uint32_t cntr_array_0;
9774 ndr_print_struct(ndr, name, "drsuapi_DsReplicaOpCtr");
9775 ndr->depth++;
9776 ndr_print_NTTIME(ndr, "time", r->time);
9777 ndr_print_uint32(ndr, "count", r->count);
9778 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
9779 ndr->depth++;
9780 for (cntr_array_0=0;cntr_array_0<r->count;cntr_array_0++) {
9781 char *idx_0=NULL;
9782 if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) {
9783 ndr_print_drsuapi_DsReplicaOp(ndr, "array", &r->array[cntr_array_0]);
9784 free(idx_0);
9787 ndr->depth--;
9788 ndr->depth--;
9791 static enum ndr_err_code ndr_push_drsuapi_DsReplicaAttrValMetaData(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaAttrValMetaData *r)
9793 if (ndr_flags & NDR_SCALARS) {
9794 NDR_CHECK(ndr_push_align(ndr, 8));
9795 NDR_CHECK(ndr_push_unique_ptr(ndr, r->attribute_name));
9796 NDR_CHECK(ndr_push_unique_ptr(ndr, r->object_dn));
9797 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_DATA_BLOB(0, r->binary, 0)));
9798 NDR_CHECK(ndr_push_unique_ptr(ndr, r->binary));
9799 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->deleted));
9800 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->created));
9801 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version));
9802 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->originating_change_time));
9803 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id));
9804 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->originating_usn));
9805 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->local_usn));
9807 if (ndr_flags & NDR_BUFFERS) {
9808 if (r->attribute_name) {
9809 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->attribute_name, CH_UTF16)));
9810 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
9811 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->attribute_name, CH_UTF16)));
9812 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->attribute_name, ndr_charset_length(r->attribute_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
9814 if (r->object_dn) {
9815 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->object_dn, CH_UTF16)));
9816 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
9817 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->object_dn, CH_UTF16)));
9818 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->object_dn, ndr_charset_length(r->object_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16));
9820 if (r->binary) {
9821 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, *r->binary));
9824 return NDR_ERR_SUCCESS;
9827 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaAttrValMetaData(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaAttrValMetaData *r)
9829 uint32_t _ptr_attribute_name;
9830 TALLOC_CTX *_mem_save_attribute_name_0;
9831 uint32_t _ptr_object_dn;
9832 TALLOC_CTX *_mem_save_object_dn_0;
9833 uint32_t _ptr_binary;
9834 TALLOC_CTX *_mem_save_binary_0;
9835 if (ndr_flags & NDR_SCALARS) {
9836 NDR_CHECK(ndr_pull_align(ndr, 8));
9837 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_attribute_name));
9838 if (_ptr_attribute_name) {
9839 NDR_PULL_ALLOC(ndr, r->attribute_name);
9840 } else {
9841 r->attribute_name = NULL;
9843 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_object_dn));
9844 if (_ptr_object_dn) {
9845 NDR_PULL_ALLOC(ndr, r->object_dn);
9846 } else {
9847 r->object_dn = NULL;
9849 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_binary));
9850 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_binary));
9851 if (_ptr_binary) {
9852 NDR_PULL_ALLOC(ndr, r->binary);
9853 } else {
9854 r->binary = NULL;
9856 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->deleted));
9857 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->created));
9858 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
9859 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->originating_change_time));
9860 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id));
9861 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->originating_usn));
9862 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->local_usn));
9864 if (ndr_flags & NDR_BUFFERS) {
9865 if (r->attribute_name) {
9866 _mem_save_attribute_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
9867 NDR_PULL_SET_MEM_CTX(ndr, r->attribute_name, 0);
9868 NDR_CHECK(ndr_pull_array_size(ndr, &r->attribute_name));
9869 NDR_CHECK(ndr_pull_array_length(ndr, &r->attribute_name));
9870 if (ndr_get_array_length(ndr, &r->attribute_name) > ndr_get_array_size(ndr, &r->attribute_name)) {
9871 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));
9873 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->attribute_name), sizeof(uint16_t)));
9874 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->attribute_name, ndr_get_array_length(ndr, &r->attribute_name), sizeof(uint16_t), CH_UTF16));
9875 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attribute_name_0, 0);
9877 if (r->object_dn) {
9878 _mem_save_object_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
9879 NDR_PULL_SET_MEM_CTX(ndr, r->object_dn, 0);
9880 NDR_CHECK(ndr_pull_array_size(ndr, &r->object_dn));
9881 NDR_CHECK(ndr_pull_array_length(ndr, &r->object_dn));
9882 if (ndr_get_array_length(ndr, &r->object_dn) > ndr_get_array_size(ndr, &r->object_dn)) {
9883 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));
9885 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->object_dn), sizeof(uint16_t)));
9886 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->object_dn, ndr_get_array_length(ndr, &r->object_dn), sizeof(uint16_t), CH_UTF16));
9887 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_object_dn_0, 0);
9889 if (r->binary) {
9890 _mem_save_binary_0 = NDR_PULL_GET_MEM_CTX(ndr);
9891 NDR_PULL_SET_MEM_CTX(ndr, r->binary, 0);
9892 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, r->binary));
9893 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_binary_0, 0);
9896 return NDR_ERR_SUCCESS;
9899 _PUBLIC_ void ndr_print_drsuapi_DsReplicaAttrValMetaData(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaAttrValMetaData *r)
9901 ndr_print_struct(ndr, name, "drsuapi_DsReplicaAttrValMetaData");
9902 ndr->depth++;
9903 ndr_print_ptr(ndr, "attribute_name", r->attribute_name);
9904 ndr->depth++;
9905 if (r->attribute_name) {
9906 ndr_print_string(ndr, "attribute_name", r->attribute_name);
9908 ndr->depth--;
9909 ndr_print_ptr(ndr, "object_dn", r->object_dn);
9910 ndr->depth++;
9911 if (r->object_dn) {
9912 ndr_print_string(ndr, "object_dn", r->object_dn);
9914 ndr->depth--;
9915 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);
9916 ndr_print_ptr(ndr, "binary", r->binary);
9917 ndr->depth++;
9918 if (r->binary) {
9919 ndr_print_DATA_BLOB(ndr, "binary", *r->binary);
9921 ndr->depth--;
9922 ndr_print_NTTIME(ndr, "deleted", r->deleted);
9923 ndr_print_NTTIME(ndr, "created", r->created);
9924 ndr_print_uint32(ndr, "version", r->version);
9925 ndr_print_NTTIME(ndr, "originating_change_time", r->originating_change_time);
9926 ndr_print_GUID(ndr, "originating_invocation_id", &r->originating_invocation_id);
9927 ndr_print_hyper(ndr, "originating_usn", r->originating_usn);
9928 ndr_print_hyper(ndr, "local_usn", r->local_usn);
9929 ndr->depth--;
9932 static enum ndr_err_code ndr_push_drsuapi_DsReplicaAttrValMetaDataCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaAttrValMetaDataCtr *r)
9934 uint32_t cntr_array_0;
9935 if (ndr_flags & NDR_SCALARS) {
9936 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
9937 NDR_CHECK(ndr_push_align(ndr, 8));
9938 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
9939 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->enumeration_context));
9940 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
9941 NDR_CHECK(ndr_push_drsuapi_DsReplicaAttrValMetaData(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
9944 if (ndr_flags & NDR_BUFFERS) {
9945 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
9946 NDR_CHECK(ndr_push_drsuapi_DsReplicaAttrValMetaData(ndr, NDR_BUFFERS, &r->array[cntr_array_0]));
9949 return NDR_ERR_SUCCESS;
9952 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaAttrValMetaDataCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaAttrValMetaDataCtr *r)
9954 uint32_t cntr_array_0;
9955 TALLOC_CTX *_mem_save_array_0;
9956 if (ndr_flags & NDR_SCALARS) {
9957 NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
9958 NDR_CHECK(ndr_pull_align(ndr, 8));
9959 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
9960 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->enumeration_context));
9961 NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
9962 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
9963 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
9964 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
9965 NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttrValMetaData(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
9967 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
9968 if (r->array) {
9969 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
9972 if (ndr_flags & NDR_BUFFERS) {
9973 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
9974 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
9975 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
9976 NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttrValMetaData(ndr, NDR_BUFFERS, &r->array[cntr_array_0]));
9978 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
9980 return NDR_ERR_SUCCESS;
9983 _PUBLIC_ void ndr_print_drsuapi_DsReplicaAttrValMetaDataCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaAttrValMetaDataCtr *r)
9985 uint32_t cntr_array_0;
9986 ndr_print_struct(ndr, name, "drsuapi_DsReplicaAttrValMetaDataCtr");
9987 ndr->depth++;
9988 ndr_print_uint32(ndr, "count", r->count);
9989 ndr_print_int32(ndr, "enumeration_context", r->enumeration_context);
9990 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
9991 ndr->depth++;
9992 for (cntr_array_0=0;cntr_array_0<r->count;cntr_array_0++) {
9993 char *idx_0=NULL;
9994 if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) {
9995 ndr_print_drsuapi_DsReplicaAttrValMetaData(ndr, "array", &r->array[cntr_array_0]);
9996 free(idx_0);
9999 ndr->depth--;
10000 ndr->depth--;
10003 static enum ndr_err_code ndr_push_drsuapi_DsReplicaCursor2Ctr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursor2Ctr *r)
10005 uint32_t cntr_array_0;
10006 if (ndr_flags & NDR_SCALARS) {
10007 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
10008 NDR_CHECK(ndr_push_align(ndr, 8));
10009 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
10010 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->enumeration_context));
10011 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
10012 NDR_CHECK(ndr_push_drsuapi_DsReplicaCursor2(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
10015 if (ndr_flags & NDR_BUFFERS) {
10017 return NDR_ERR_SUCCESS;
10020 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursor2Ctr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursor2Ctr *r)
10022 uint32_t cntr_array_0;
10023 TALLOC_CTX *_mem_save_array_0;
10024 if (ndr_flags & NDR_SCALARS) {
10025 NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
10026 NDR_CHECK(ndr_pull_align(ndr, 8));
10027 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
10028 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->enumeration_context));
10029 NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
10030 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
10031 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
10032 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
10033 NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursor2(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
10035 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
10036 if (r->array) {
10037 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
10040 if (ndr_flags & NDR_BUFFERS) {
10042 return NDR_ERR_SUCCESS;
10045 _PUBLIC_ void ndr_print_drsuapi_DsReplicaCursor2Ctr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursor2Ctr *r)
10047 uint32_t cntr_array_0;
10048 ndr_print_struct(ndr, name, "drsuapi_DsReplicaCursor2Ctr");
10049 ndr->depth++;
10050 ndr_print_uint32(ndr, "count", r->count);
10051 ndr_print_int32(ndr, "enumeration_context", r->enumeration_context);
10052 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
10053 ndr->depth++;
10054 for (cntr_array_0=0;cntr_array_0<r->count;cntr_array_0++) {
10055 char *idx_0=NULL;
10056 if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) {
10057 ndr_print_drsuapi_DsReplicaCursor2(ndr, "array", &r->array[cntr_array_0]);
10058 free(idx_0);
10061 ndr->depth--;
10062 ndr->depth--;
10065 static enum ndr_err_code ndr_push_drsuapi_DsReplicaCursor3(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursor3 *r)
10067 if (ndr_flags & NDR_SCALARS) {
10068 NDR_CHECK(ndr_push_align(ndr, 8));
10069 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
10070 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->highest_usn));
10071 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_sync_success));
10072 NDR_CHECK(ndr_push_unique_ptr(ndr, r->source_dsa_obj_dn));
10074 if (ndr_flags & NDR_BUFFERS) {
10075 if (r->source_dsa_obj_dn) {
10076 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->source_dsa_obj_dn, CH_UTF16)));
10077 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
10078 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->source_dsa_obj_dn, CH_UTF16)));
10079 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));
10082 return NDR_ERR_SUCCESS;
10085 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursor3(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursor3 *r)
10087 uint32_t _ptr_source_dsa_obj_dn;
10088 TALLOC_CTX *_mem_save_source_dsa_obj_dn_0;
10089 if (ndr_flags & NDR_SCALARS) {
10090 NDR_CHECK(ndr_pull_align(ndr, 8));
10091 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
10092 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->highest_usn));
10093 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_sync_success));
10094 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_source_dsa_obj_dn));
10095 if (_ptr_source_dsa_obj_dn) {
10096 NDR_PULL_ALLOC(ndr, r->source_dsa_obj_dn);
10097 } else {
10098 r->source_dsa_obj_dn = NULL;
10101 if (ndr_flags & NDR_BUFFERS) {
10102 if (r->source_dsa_obj_dn) {
10103 _mem_save_source_dsa_obj_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
10104 NDR_PULL_SET_MEM_CTX(ndr, r->source_dsa_obj_dn, 0);
10105 NDR_CHECK(ndr_pull_array_size(ndr, &r->source_dsa_obj_dn));
10106 NDR_CHECK(ndr_pull_array_length(ndr, &r->source_dsa_obj_dn));
10107 if (ndr_get_array_length(ndr, &r->source_dsa_obj_dn) > ndr_get_array_size(ndr, &r->source_dsa_obj_dn)) {
10108 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));
10110 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->source_dsa_obj_dn), sizeof(uint16_t)));
10111 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));
10112 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_source_dsa_obj_dn_0, 0);
10115 return NDR_ERR_SUCCESS;
10118 _PUBLIC_ void ndr_print_drsuapi_DsReplicaCursor3(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursor3 *r)
10120 ndr_print_struct(ndr, name, "drsuapi_DsReplicaCursor3");
10121 ndr->depth++;
10122 ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id);
10123 ndr_print_hyper(ndr, "highest_usn", r->highest_usn);
10124 ndr_print_NTTIME(ndr, "last_sync_success", r->last_sync_success);
10125 ndr_print_ptr(ndr, "source_dsa_obj_dn", r->source_dsa_obj_dn);
10126 ndr->depth++;
10127 if (r->source_dsa_obj_dn) {
10128 ndr_print_string(ndr, "source_dsa_obj_dn", r->source_dsa_obj_dn);
10130 ndr->depth--;
10131 ndr->depth--;
10134 static enum ndr_err_code ndr_push_drsuapi_DsReplicaCursor3Ctr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursor3Ctr *r)
10136 uint32_t cntr_array_0;
10137 if (ndr_flags & NDR_SCALARS) {
10138 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
10139 NDR_CHECK(ndr_push_align(ndr, 8));
10140 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
10141 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->enumeration_context));
10142 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
10143 NDR_CHECK(ndr_push_drsuapi_DsReplicaCursor3(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
10146 if (ndr_flags & NDR_BUFFERS) {
10147 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
10148 NDR_CHECK(ndr_push_drsuapi_DsReplicaCursor3(ndr, NDR_BUFFERS, &r->array[cntr_array_0]));
10151 return NDR_ERR_SUCCESS;
10154 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursor3Ctr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursor3Ctr *r)
10156 uint32_t cntr_array_0;
10157 TALLOC_CTX *_mem_save_array_0;
10158 if (ndr_flags & NDR_SCALARS) {
10159 NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
10160 NDR_CHECK(ndr_pull_align(ndr, 8));
10161 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
10162 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->enumeration_context));
10163 NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
10164 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
10165 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
10166 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
10167 NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursor3(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
10169 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
10170 if (r->array) {
10171 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
10174 if (ndr_flags & NDR_BUFFERS) {
10175 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
10176 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
10177 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
10178 NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursor3(ndr, NDR_BUFFERS, &r->array[cntr_array_0]));
10180 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
10182 return NDR_ERR_SUCCESS;
10185 _PUBLIC_ void ndr_print_drsuapi_DsReplicaCursor3Ctr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursor3Ctr *r)
10187 uint32_t cntr_array_0;
10188 ndr_print_struct(ndr, name, "drsuapi_DsReplicaCursor3Ctr");
10189 ndr->depth++;
10190 ndr_print_uint32(ndr, "count", r->count);
10191 ndr_print_int32(ndr, "enumeration_context", r->enumeration_context);
10192 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
10193 ndr->depth++;
10194 for (cntr_array_0=0;cntr_array_0<r->count;cntr_array_0++) {
10195 char *idx_0=NULL;
10196 if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) {
10197 ndr_print_drsuapi_DsReplicaCursor3(ndr, "array", &r->array[cntr_array_0]);
10198 free(idx_0);
10201 ndr->depth--;
10202 ndr->depth--;
10205 static enum ndr_err_code ndr_push_drsuapi_DsReplicaObjMetaData2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjMetaData2 *r)
10207 if (ndr_flags & NDR_SCALARS) {
10208 NDR_CHECK(ndr_push_align(ndr, 8));
10209 NDR_CHECK(ndr_push_unique_ptr(ndr, r->attribute_name));
10210 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version));
10211 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->originating_change_time));
10212 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id));
10213 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->originating_usn));
10214 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->local_usn));
10215 NDR_CHECK(ndr_push_unique_ptr(ndr, r->originating_dsa_dn));
10217 if (ndr_flags & NDR_BUFFERS) {
10218 if (r->attribute_name) {
10219 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->attribute_name, CH_UTF16)));
10220 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
10221 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->attribute_name, CH_UTF16)));
10222 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->attribute_name, ndr_charset_length(r->attribute_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
10224 if (r->originating_dsa_dn) {
10225 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->originating_dsa_dn, CH_UTF16)));
10226 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
10227 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->originating_dsa_dn, CH_UTF16)));
10228 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));
10231 return NDR_ERR_SUCCESS;
10234 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjMetaData2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjMetaData2 *r)
10236 uint32_t _ptr_attribute_name;
10237 TALLOC_CTX *_mem_save_attribute_name_0;
10238 uint32_t _ptr_originating_dsa_dn;
10239 TALLOC_CTX *_mem_save_originating_dsa_dn_0;
10240 if (ndr_flags & NDR_SCALARS) {
10241 NDR_CHECK(ndr_pull_align(ndr, 8));
10242 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_attribute_name));
10243 if (_ptr_attribute_name) {
10244 NDR_PULL_ALLOC(ndr, r->attribute_name);
10245 } else {
10246 r->attribute_name = NULL;
10248 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
10249 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->originating_change_time));
10250 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id));
10251 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->originating_usn));
10252 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->local_usn));
10253 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_originating_dsa_dn));
10254 if (_ptr_originating_dsa_dn) {
10255 NDR_PULL_ALLOC(ndr, r->originating_dsa_dn);
10256 } else {
10257 r->originating_dsa_dn = NULL;
10260 if (ndr_flags & NDR_BUFFERS) {
10261 if (r->attribute_name) {
10262 _mem_save_attribute_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
10263 NDR_PULL_SET_MEM_CTX(ndr, r->attribute_name, 0);
10264 NDR_CHECK(ndr_pull_array_size(ndr, &r->attribute_name));
10265 NDR_CHECK(ndr_pull_array_length(ndr, &r->attribute_name));
10266 if (ndr_get_array_length(ndr, &r->attribute_name) > ndr_get_array_size(ndr, &r->attribute_name)) {
10267 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));
10269 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->attribute_name), sizeof(uint16_t)));
10270 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->attribute_name, ndr_get_array_length(ndr, &r->attribute_name), sizeof(uint16_t), CH_UTF16));
10271 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attribute_name_0, 0);
10273 if (r->originating_dsa_dn) {
10274 _mem_save_originating_dsa_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
10275 NDR_PULL_SET_MEM_CTX(ndr, r->originating_dsa_dn, 0);
10276 NDR_CHECK(ndr_pull_array_size(ndr, &r->originating_dsa_dn));
10277 NDR_CHECK(ndr_pull_array_length(ndr, &r->originating_dsa_dn));
10278 if (ndr_get_array_length(ndr, &r->originating_dsa_dn) > ndr_get_array_size(ndr, &r->originating_dsa_dn)) {
10279 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));
10281 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->originating_dsa_dn), sizeof(uint16_t)));
10282 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));
10283 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_originating_dsa_dn_0, 0);
10286 return NDR_ERR_SUCCESS;
10289 _PUBLIC_ void ndr_print_drsuapi_DsReplicaObjMetaData2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjMetaData2 *r)
10291 ndr_print_struct(ndr, name, "drsuapi_DsReplicaObjMetaData2");
10292 ndr->depth++;
10293 ndr_print_ptr(ndr, "attribute_name", r->attribute_name);
10294 ndr->depth++;
10295 if (r->attribute_name) {
10296 ndr_print_string(ndr, "attribute_name", r->attribute_name);
10298 ndr->depth--;
10299 ndr_print_uint32(ndr, "version", r->version);
10300 ndr_print_NTTIME(ndr, "originating_change_time", r->originating_change_time);
10301 ndr_print_GUID(ndr, "originating_invocation_id", &r->originating_invocation_id);
10302 ndr_print_hyper(ndr, "originating_usn", r->originating_usn);
10303 ndr_print_hyper(ndr, "local_usn", r->local_usn);
10304 ndr_print_ptr(ndr, "originating_dsa_dn", r->originating_dsa_dn);
10305 ndr->depth++;
10306 if (r->originating_dsa_dn) {
10307 ndr_print_string(ndr, "originating_dsa_dn", r->originating_dsa_dn);
10309 ndr->depth--;
10310 ndr->depth--;
10313 static enum ndr_err_code ndr_push_drsuapi_DsReplicaObjMetaData2Ctr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjMetaData2Ctr *r)
10315 uint32_t cntr_array_0;
10316 if (ndr_flags & NDR_SCALARS) {
10317 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
10318 NDR_CHECK(ndr_push_align(ndr, 8));
10319 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
10320 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->enumeration_context));
10321 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
10322 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjMetaData2(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
10325 if (ndr_flags & NDR_BUFFERS) {
10326 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
10327 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjMetaData2(ndr, NDR_BUFFERS, &r->array[cntr_array_0]));
10330 return NDR_ERR_SUCCESS;
10333 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjMetaData2Ctr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjMetaData2Ctr *r)
10335 uint32_t cntr_array_0;
10336 TALLOC_CTX *_mem_save_array_0;
10337 if (ndr_flags & NDR_SCALARS) {
10338 NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
10339 NDR_CHECK(ndr_pull_align(ndr, 8));
10340 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
10341 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->enumeration_context));
10342 NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
10343 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
10344 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
10345 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
10346 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjMetaData2(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
10348 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
10349 if (r->array) {
10350 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
10353 if (ndr_flags & NDR_BUFFERS) {
10354 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
10355 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
10356 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
10357 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjMetaData2(ndr, NDR_BUFFERS, &r->array[cntr_array_0]));
10359 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
10361 return NDR_ERR_SUCCESS;
10364 _PUBLIC_ void ndr_print_drsuapi_DsReplicaObjMetaData2Ctr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjMetaData2Ctr *r)
10366 uint32_t cntr_array_0;
10367 ndr_print_struct(ndr, name, "drsuapi_DsReplicaObjMetaData2Ctr");
10368 ndr->depth++;
10369 ndr_print_uint32(ndr, "count", r->count);
10370 ndr_print_int32(ndr, "enumeration_context", r->enumeration_context);
10371 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
10372 ndr->depth++;
10373 for (cntr_array_0=0;cntr_array_0<r->count;cntr_array_0++) {
10374 char *idx_0=NULL;
10375 if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) {
10376 ndr_print_drsuapi_DsReplicaObjMetaData2(ndr, "array", &r->array[cntr_array_0]);
10377 free(idx_0);
10380 ndr->depth--;
10381 ndr->depth--;
10384 static enum ndr_err_code ndr_push_drsuapi_DsReplicaAttrValMetaData2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaAttrValMetaData2 *r)
10386 if (ndr_flags & NDR_SCALARS) {
10387 NDR_CHECK(ndr_push_align(ndr, 8));
10388 NDR_CHECK(ndr_push_unique_ptr(ndr, r->attribute_name));
10389 NDR_CHECK(ndr_push_unique_ptr(ndr, r->object_dn));
10390 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_DATA_BLOB(0, r->binary, 0)));
10391 NDR_CHECK(ndr_push_unique_ptr(ndr, r->binary));
10392 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->deleted));
10393 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->created));
10394 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version));
10395 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->originating_change_time));
10396 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id));
10397 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->originating_usn));
10398 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->local_usn));
10399 NDR_CHECK(ndr_push_unique_ptr(ndr, r->originating_dsa_dn));
10401 if (ndr_flags & NDR_BUFFERS) {
10402 if (r->attribute_name) {
10403 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->attribute_name, CH_UTF16)));
10404 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
10405 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->attribute_name, CH_UTF16)));
10406 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->attribute_name, ndr_charset_length(r->attribute_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
10408 if (r->object_dn) {
10409 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->object_dn, CH_UTF16)));
10410 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
10411 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->object_dn, CH_UTF16)));
10412 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->object_dn, ndr_charset_length(r->object_dn, CH_UTF16), sizeof(uint16_t), CH_UTF16));
10414 if (r->binary) {
10415 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, *r->binary));
10417 if (r->originating_dsa_dn) {
10418 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->originating_dsa_dn, CH_UTF16)));
10419 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
10420 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->originating_dsa_dn, CH_UTF16)));
10421 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));
10424 return NDR_ERR_SUCCESS;
10427 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaAttrValMetaData2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaAttrValMetaData2 *r)
10429 uint32_t _ptr_attribute_name;
10430 TALLOC_CTX *_mem_save_attribute_name_0;
10431 uint32_t _ptr_object_dn;
10432 TALLOC_CTX *_mem_save_object_dn_0;
10433 uint32_t _ptr_binary;
10434 TALLOC_CTX *_mem_save_binary_0;
10435 uint32_t _ptr_originating_dsa_dn;
10436 TALLOC_CTX *_mem_save_originating_dsa_dn_0;
10437 if (ndr_flags & NDR_SCALARS) {
10438 NDR_CHECK(ndr_pull_align(ndr, 8));
10439 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_attribute_name));
10440 if (_ptr_attribute_name) {
10441 NDR_PULL_ALLOC(ndr, r->attribute_name);
10442 } else {
10443 r->attribute_name = NULL;
10445 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_object_dn));
10446 if (_ptr_object_dn) {
10447 NDR_PULL_ALLOC(ndr, r->object_dn);
10448 } else {
10449 r->object_dn = NULL;
10451 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_binary));
10452 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_binary));
10453 if (_ptr_binary) {
10454 NDR_PULL_ALLOC(ndr, r->binary);
10455 } else {
10456 r->binary = NULL;
10458 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->deleted));
10459 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->created));
10460 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
10461 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->originating_change_time));
10462 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id));
10463 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->originating_usn));
10464 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->local_usn));
10465 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_originating_dsa_dn));
10466 if (_ptr_originating_dsa_dn) {
10467 NDR_PULL_ALLOC(ndr, r->originating_dsa_dn);
10468 } else {
10469 r->originating_dsa_dn = NULL;
10472 if (ndr_flags & NDR_BUFFERS) {
10473 if (r->attribute_name) {
10474 _mem_save_attribute_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
10475 NDR_PULL_SET_MEM_CTX(ndr, r->attribute_name, 0);
10476 NDR_CHECK(ndr_pull_array_size(ndr, &r->attribute_name));
10477 NDR_CHECK(ndr_pull_array_length(ndr, &r->attribute_name));
10478 if (ndr_get_array_length(ndr, &r->attribute_name) > ndr_get_array_size(ndr, &r->attribute_name)) {
10479 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));
10481 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->attribute_name), sizeof(uint16_t)));
10482 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->attribute_name, ndr_get_array_length(ndr, &r->attribute_name), sizeof(uint16_t), CH_UTF16));
10483 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attribute_name_0, 0);
10485 if (r->object_dn) {
10486 _mem_save_object_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
10487 NDR_PULL_SET_MEM_CTX(ndr, r->object_dn, 0);
10488 NDR_CHECK(ndr_pull_array_size(ndr, &r->object_dn));
10489 NDR_CHECK(ndr_pull_array_length(ndr, &r->object_dn));
10490 if (ndr_get_array_length(ndr, &r->object_dn) > ndr_get_array_size(ndr, &r->object_dn)) {
10491 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));
10493 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->object_dn), sizeof(uint16_t)));
10494 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->object_dn, ndr_get_array_length(ndr, &r->object_dn), sizeof(uint16_t), CH_UTF16));
10495 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_object_dn_0, 0);
10497 if (r->binary) {
10498 _mem_save_binary_0 = NDR_PULL_GET_MEM_CTX(ndr);
10499 NDR_PULL_SET_MEM_CTX(ndr, r->binary, 0);
10500 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, r->binary));
10501 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_binary_0, 0);
10503 if (r->originating_dsa_dn) {
10504 _mem_save_originating_dsa_dn_0 = NDR_PULL_GET_MEM_CTX(ndr);
10505 NDR_PULL_SET_MEM_CTX(ndr, r->originating_dsa_dn, 0);
10506 NDR_CHECK(ndr_pull_array_size(ndr, &r->originating_dsa_dn));
10507 NDR_CHECK(ndr_pull_array_length(ndr, &r->originating_dsa_dn));
10508 if (ndr_get_array_length(ndr, &r->originating_dsa_dn) > ndr_get_array_size(ndr, &r->originating_dsa_dn)) {
10509 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));
10511 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->originating_dsa_dn), sizeof(uint16_t)));
10512 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));
10513 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_originating_dsa_dn_0, 0);
10516 return NDR_ERR_SUCCESS;
10519 _PUBLIC_ void ndr_print_drsuapi_DsReplicaAttrValMetaData2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaAttrValMetaData2 *r)
10521 ndr_print_struct(ndr, name, "drsuapi_DsReplicaAttrValMetaData2");
10522 ndr->depth++;
10523 ndr_print_ptr(ndr, "attribute_name", r->attribute_name);
10524 ndr->depth++;
10525 if (r->attribute_name) {
10526 ndr_print_string(ndr, "attribute_name", r->attribute_name);
10528 ndr->depth--;
10529 ndr_print_ptr(ndr, "object_dn", r->object_dn);
10530 ndr->depth++;
10531 if (r->object_dn) {
10532 ndr_print_string(ndr, "object_dn", r->object_dn);
10534 ndr->depth--;
10535 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);
10536 ndr_print_ptr(ndr, "binary", r->binary);
10537 ndr->depth++;
10538 if (r->binary) {
10539 ndr_print_DATA_BLOB(ndr, "binary", *r->binary);
10541 ndr->depth--;
10542 ndr_print_NTTIME(ndr, "deleted", r->deleted);
10543 ndr_print_NTTIME(ndr, "created", r->created);
10544 ndr_print_uint32(ndr, "version", r->version);
10545 ndr_print_NTTIME(ndr, "originating_change_time", r->originating_change_time);
10546 ndr_print_GUID(ndr, "originating_invocation_id", &r->originating_invocation_id);
10547 ndr_print_hyper(ndr, "originating_usn", r->originating_usn);
10548 ndr_print_hyper(ndr, "local_usn", r->local_usn);
10549 ndr_print_ptr(ndr, "originating_dsa_dn", r->originating_dsa_dn);
10550 ndr->depth++;
10551 if (r->originating_dsa_dn) {
10552 ndr_print_string(ndr, "originating_dsa_dn", r->originating_dsa_dn);
10554 ndr->depth--;
10555 ndr->depth--;
10558 static enum ndr_err_code ndr_push_drsuapi_DsReplicaAttrValMetaData2Ctr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaAttrValMetaData2Ctr *r)
10560 uint32_t cntr_array_0;
10561 if (ndr_flags & NDR_SCALARS) {
10562 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
10563 NDR_CHECK(ndr_push_align(ndr, 8));
10564 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
10565 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->enumeration_context));
10566 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
10567 NDR_CHECK(ndr_push_drsuapi_DsReplicaAttrValMetaData2(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
10570 if (ndr_flags & NDR_BUFFERS) {
10571 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
10572 NDR_CHECK(ndr_push_drsuapi_DsReplicaAttrValMetaData2(ndr, NDR_BUFFERS, &r->array[cntr_array_0]));
10575 return NDR_ERR_SUCCESS;
10578 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaAttrValMetaData2Ctr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaAttrValMetaData2Ctr *r)
10580 uint32_t cntr_array_0;
10581 TALLOC_CTX *_mem_save_array_0;
10582 if (ndr_flags & NDR_SCALARS) {
10583 NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
10584 NDR_CHECK(ndr_pull_align(ndr, 8));
10585 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
10586 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->enumeration_context));
10587 NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
10588 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
10589 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
10590 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
10591 NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttrValMetaData2(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
10593 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
10594 if (r->array) {
10595 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
10598 if (ndr_flags & NDR_BUFFERS) {
10599 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
10600 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
10601 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
10602 NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttrValMetaData2(ndr, NDR_BUFFERS, &r->array[cntr_array_0]));
10604 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
10606 return NDR_ERR_SUCCESS;
10609 _PUBLIC_ void ndr_print_drsuapi_DsReplicaAttrValMetaData2Ctr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaAttrValMetaData2Ctr *r)
10611 uint32_t cntr_array_0;
10612 ndr_print_struct(ndr, name, "drsuapi_DsReplicaAttrValMetaData2Ctr");
10613 ndr->depth++;
10614 ndr_print_uint32(ndr, "count", r->count);
10615 ndr_print_int32(ndr, "enumeration_context", r->enumeration_context);
10616 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
10617 ndr->depth++;
10618 for (cntr_array_0=0;cntr_array_0<r->count;cntr_array_0++) {
10619 char *idx_0=NULL;
10620 if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) {
10621 ndr_print_drsuapi_DsReplicaAttrValMetaData2(ndr, "array", &r->array[cntr_array_0]);
10622 free(idx_0);
10625 ndr->depth--;
10626 ndr->depth--;
10629 static enum ndr_err_code ndr_push_drsuapi_DsReplicaConnection04(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaConnection04 *r)
10631 if (ndr_flags & NDR_SCALARS) {
10632 NDR_CHECK(ndr_push_align(ndr, 8));
10633 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->u1));
10634 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->u2));
10635 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->u3));
10636 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->bind_guid));
10637 NDR_CHECK(ndr_push_NTTIME_1sec(ndr, NDR_SCALARS, r->bind_time));
10639 uint32_t _flags_save_ipv4address = ndr->flags;
10640 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
10641 NDR_CHECK(ndr_push_ipv4address(ndr, NDR_SCALARS, r->client_ip_address));
10642 ndr->flags = _flags_save_ipv4address;
10644 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->u5));
10646 if (ndr_flags & NDR_BUFFERS) {
10648 return NDR_ERR_SUCCESS;
10651 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaConnection04(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaConnection04 *r)
10653 if (ndr_flags & NDR_SCALARS) {
10654 NDR_CHECK(ndr_pull_align(ndr, 8));
10655 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->u1));
10656 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->u2));
10657 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->u3));
10658 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->bind_guid));
10659 NDR_CHECK(ndr_pull_NTTIME_1sec(ndr, NDR_SCALARS, &r->bind_time));
10661 uint32_t _flags_save_ipv4address = ndr->flags;
10662 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
10663 NDR_CHECK(ndr_pull_ipv4address(ndr, NDR_SCALARS, &r->client_ip_address));
10664 ndr->flags = _flags_save_ipv4address;
10666 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->u5));
10668 if (ndr_flags & NDR_BUFFERS) {
10670 return NDR_ERR_SUCCESS;
10673 _PUBLIC_ void ndr_print_drsuapi_DsReplicaConnection04(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaConnection04 *r)
10675 ndr_print_struct(ndr, name, "drsuapi_DsReplicaConnection04");
10676 ndr->depth++;
10677 ndr_print_hyper(ndr, "u1", r->u1);
10678 ndr_print_uint32(ndr, "u2", r->u2);
10679 ndr_print_uint32(ndr, "u3", r->u3);
10680 ndr_print_GUID(ndr, "bind_guid", &r->bind_guid);
10681 ndr_print_NTTIME_1sec(ndr, "bind_time", r->bind_time);
10682 ndr_print_ipv4address(ndr, "client_ip_address", r->client_ip_address);
10683 ndr_print_uint32(ndr, "u5", r->u5);
10684 ndr->depth--;
10687 static enum ndr_err_code ndr_push_drsuapi_DsReplicaConnection04Ctr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaConnection04Ctr *r)
10689 uint32_t cntr_array_0;
10690 if (ndr_flags & NDR_SCALARS) {
10691 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
10692 NDR_CHECK(ndr_push_align(ndr, 8));
10693 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
10694 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved));
10695 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
10696 NDR_CHECK(ndr_push_drsuapi_DsReplicaConnection04(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
10699 if (ndr_flags & NDR_BUFFERS) {
10701 return NDR_ERR_SUCCESS;
10704 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaConnection04Ctr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaConnection04Ctr *r)
10706 uint32_t cntr_array_0;
10707 TALLOC_CTX *_mem_save_array_0;
10708 if (ndr_flags & NDR_SCALARS) {
10709 NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
10710 NDR_CHECK(ndr_pull_align(ndr, 8));
10711 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
10712 if (r->count > 10000) {
10713 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
10715 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved));
10716 NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
10717 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
10718 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
10719 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
10720 NDR_CHECK(ndr_pull_drsuapi_DsReplicaConnection04(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
10722 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
10723 if (r->array) {
10724 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
10727 if (ndr_flags & NDR_BUFFERS) {
10729 return NDR_ERR_SUCCESS;
10732 _PUBLIC_ void ndr_print_drsuapi_DsReplicaConnection04Ctr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaConnection04Ctr *r)
10734 uint32_t cntr_array_0;
10735 ndr_print_struct(ndr, name, "drsuapi_DsReplicaConnection04Ctr");
10736 ndr->depth++;
10737 ndr_print_uint32(ndr, "count", r->count);
10738 ndr_print_uint32(ndr, "reserved", r->reserved);
10739 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
10740 ndr->depth++;
10741 for (cntr_array_0=0;cntr_array_0<r->count;cntr_array_0++) {
10742 char *idx_0=NULL;
10743 if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) {
10744 ndr_print_drsuapi_DsReplicaConnection04(ndr, "array", &r->array[cntr_array_0]);
10745 free(idx_0);
10748 ndr->depth--;
10749 ndr->depth--;
10752 static enum ndr_err_code ndr_push_drsuapi_DsReplica06(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplica06 *r)
10754 if (ndr_flags & NDR_SCALARS) {
10755 NDR_CHECK(ndr_push_align(ndr, 8));
10756 NDR_CHECK(ndr_push_unique_ptr(ndr, r->str1));
10757 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->u1));
10758 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->u2));
10759 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->u3));
10760 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->u4));
10761 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->u5));
10762 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->u6));
10763 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->u7));
10765 if (ndr_flags & NDR_BUFFERS) {
10766 if (r->str1) {
10767 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->str1, CH_UTF16)));
10768 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
10769 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->str1, CH_UTF16)));
10770 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->str1, ndr_charset_length(r->str1, CH_UTF16), sizeof(uint16_t), CH_UTF16));
10773 return NDR_ERR_SUCCESS;
10776 static enum ndr_err_code ndr_pull_drsuapi_DsReplica06(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplica06 *r)
10778 uint32_t _ptr_str1;
10779 TALLOC_CTX *_mem_save_str1_0;
10780 if (ndr_flags & NDR_SCALARS) {
10781 NDR_CHECK(ndr_pull_align(ndr, 8));
10782 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_str1));
10783 if (_ptr_str1) {
10784 NDR_PULL_ALLOC(ndr, r->str1);
10785 } else {
10786 r->str1 = NULL;
10788 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->u1));
10789 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->u2));
10790 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->u3));
10791 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->u4));
10792 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->u5));
10793 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->u6));
10794 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->u7));
10796 if (ndr_flags & NDR_BUFFERS) {
10797 if (r->str1) {
10798 _mem_save_str1_0 = NDR_PULL_GET_MEM_CTX(ndr);
10799 NDR_PULL_SET_MEM_CTX(ndr, r->str1, 0);
10800 NDR_CHECK(ndr_pull_array_size(ndr, &r->str1));
10801 NDR_CHECK(ndr_pull_array_length(ndr, &r->str1));
10802 if (ndr_get_array_length(ndr, &r->str1) > ndr_get_array_size(ndr, &r->str1)) {
10803 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));
10805 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->str1), sizeof(uint16_t)));
10806 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->str1, ndr_get_array_length(ndr, &r->str1), sizeof(uint16_t), CH_UTF16));
10807 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_str1_0, 0);
10810 return NDR_ERR_SUCCESS;
10813 _PUBLIC_ void ndr_print_drsuapi_DsReplica06(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplica06 *r)
10815 ndr_print_struct(ndr, name, "drsuapi_DsReplica06");
10816 ndr->depth++;
10817 ndr_print_ptr(ndr, "str1", r->str1);
10818 ndr->depth++;
10819 if (r->str1) {
10820 ndr_print_string(ndr, "str1", r->str1);
10822 ndr->depth--;
10823 ndr_print_uint32(ndr, "u1", r->u1);
10824 ndr_print_uint32(ndr, "u2", r->u2);
10825 ndr_print_uint32(ndr, "u3", r->u3);
10826 ndr_print_uint32(ndr, "u4", r->u4);
10827 ndr_print_uint32(ndr, "u5", r->u5);
10828 ndr_print_hyper(ndr, "u6", r->u6);
10829 ndr_print_uint32(ndr, "u7", r->u7);
10830 ndr->depth--;
10833 static enum ndr_err_code ndr_push_drsuapi_DsReplica06Ctr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplica06Ctr *r)
10835 uint32_t cntr_array_0;
10836 if (ndr_flags & NDR_SCALARS) {
10837 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
10838 NDR_CHECK(ndr_push_align(ndr, 8));
10839 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
10840 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved));
10841 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
10842 NDR_CHECK(ndr_push_drsuapi_DsReplica06(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
10845 if (ndr_flags & NDR_BUFFERS) {
10846 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
10847 NDR_CHECK(ndr_push_drsuapi_DsReplica06(ndr, NDR_BUFFERS, &r->array[cntr_array_0]));
10850 return NDR_ERR_SUCCESS;
10853 static enum ndr_err_code ndr_pull_drsuapi_DsReplica06Ctr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplica06Ctr *r)
10855 uint32_t cntr_array_0;
10856 TALLOC_CTX *_mem_save_array_0;
10857 if (ndr_flags & NDR_SCALARS) {
10858 NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
10859 NDR_CHECK(ndr_pull_align(ndr, 8));
10860 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
10861 if (r->count > 256) {
10862 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
10864 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved));
10865 NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
10866 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
10867 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
10868 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
10869 NDR_CHECK(ndr_pull_drsuapi_DsReplica06(ndr, NDR_SCALARS, &r->array[cntr_array_0]));
10871 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
10872 if (r->array) {
10873 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->count));
10876 if (ndr_flags & NDR_BUFFERS) {
10877 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
10878 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
10879 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) {
10880 NDR_CHECK(ndr_pull_drsuapi_DsReplica06(ndr, NDR_BUFFERS, &r->array[cntr_array_0]));
10882 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
10884 return NDR_ERR_SUCCESS;
10887 _PUBLIC_ void ndr_print_drsuapi_DsReplica06Ctr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplica06Ctr *r)
10889 uint32_t cntr_array_0;
10890 ndr_print_struct(ndr, name, "drsuapi_DsReplica06Ctr");
10891 ndr->depth++;
10892 ndr_print_uint32(ndr, "count", r->count);
10893 ndr_print_uint32(ndr, "reserved", r->reserved);
10894 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->count);
10895 ndr->depth++;
10896 for (cntr_array_0=0;cntr_array_0<r->count;cntr_array_0++) {
10897 char *idx_0=NULL;
10898 if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) {
10899 ndr_print_drsuapi_DsReplica06(ndr, "array", &r->array[cntr_array_0]);
10900 free(idx_0);
10903 ndr->depth--;
10904 ndr->depth--;
10907 static enum ndr_err_code ndr_push_drsuapi_DsReplicaInfo(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsReplicaInfo *r)
10909 if (ndr_flags & NDR_SCALARS) {
10910 int level = ndr_push_get_switch_value(ndr, r);
10911 NDR_CHECK(ndr_push_drsuapi_DsReplicaInfoType(ndr, NDR_SCALARS, level));
10912 switch (level) {
10913 case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS: {
10914 NDR_CHECK(ndr_push_unique_ptr(ndr, r->neighbours));
10915 break; }
10917 case DRSUAPI_DS_REPLICA_INFO_CURSORS: {
10918 NDR_CHECK(ndr_push_unique_ptr(ndr, r->cursors));
10919 break; }
10921 case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA: {
10922 NDR_CHECK(ndr_push_unique_ptr(ndr, r->objmetadata));
10923 break; }
10925 case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES: {
10926 NDR_CHECK(ndr_push_unique_ptr(ndr, r->connectfailures));
10927 break; }
10929 case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES: {
10930 NDR_CHECK(ndr_push_unique_ptr(ndr, r->linkfailures));
10931 break; }
10933 case DRSUAPI_DS_REPLICA_INFO_PENDING_OPS: {
10934 NDR_CHECK(ndr_push_unique_ptr(ndr, r->pendingops));
10935 break; }
10937 case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA: {
10938 NDR_CHECK(ndr_push_unique_ptr(ndr, r->attrvalmetadata));
10939 break; }
10941 case DRSUAPI_DS_REPLICA_INFO_CURSORS2: {
10942 NDR_CHECK(ndr_push_unique_ptr(ndr, r->cursors2));
10943 break; }
10945 case DRSUAPI_DS_REPLICA_INFO_CURSORS3: {
10946 NDR_CHECK(ndr_push_unique_ptr(ndr, r->cursors3));
10947 break; }
10949 case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2: {
10950 NDR_CHECK(ndr_push_unique_ptr(ndr, r->objmetadata2));
10951 break; }
10953 case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2: {
10954 NDR_CHECK(ndr_push_unique_ptr(ndr, r->attrvalmetadata2));
10955 break; }
10957 case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS02: {
10958 NDR_CHECK(ndr_push_unique_ptr(ndr, r->neighbours02));
10959 break; }
10961 case DRSUAPI_DS_REPLICA_INFO_CONNECTIONS04: {
10962 NDR_CHECK(ndr_push_unique_ptr(ndr, r->connections04));
10963 break; }
10965 case DRSUAPI_DS_REPLICA_INFO_CURSORS05: {
10966 NDR_CHECK(ndr_push_unique_ptr(ndr, r->cursors05));
10967 break; }
10969 case DRSUAPI_DS_REPLICA_INFO_06: {
10970 NDR_CHECK(ndr_push_unique_ptr(ndr, r->i06));
10971 break; }
10973 default:
10974 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
10977 if (ndr_flags & NDR_BUFFERS) {
10978 int level = ndr_push_get_switch_value(ndr, r);
10979 switch (level) {
10980 case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS:
10981 if (r->neighbours) {
10982 NDR_CHECK(ndr_push_drsuapi_DsReplicaNeighbourCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->neighbours));
10984 break;
10986 case DRSUAPI_DS_REPLICA_INFO_CURSORS:
10987 if (r->cursors) {
10988 NDR_CHECK(ndr_push_drsuapi_DsReplicaCursorCtr(ndr, NDR_SCALARS, r->cursors));
10990 break;
10992 case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA:
10993 if (r->objmetadata) {
10994 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjMetaDataCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->objmetadata));
10996 break;
10998 case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES:
10999 if (r->connectfailures) {
11000 NDR_CHECK(ndr_push_drsuapi_DsReplicaKccDsaFailuresCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->connectfailures));
11002 break;
11004 case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES:
11005 if (r->linkfailures) {
11006 NDR_CHECK(ndr_push_drsuapi_DsReplicaKccDsaFailuresCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->linkfailures));
11008 break;
11010 case DRSUAPI_DS_REPLICA_INFO_PENDING_OPS:
11011 if (r->pendingops) {
11012 NDR_CHECK(ndr_push_drsuapi_DsReplicaOpCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->pendingops));
11014 break;
11016 case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA:
11017 if (r->attrvalmetadata) {
11018 NDR_CHECK(ndr_push_drsuapi_DsReplicaAttrValMetaDataCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->attrvalmetadata));
11020 break;
11022 case DRSUAPI_DS_REPLICA_INFO_CURSORS2:
11023 if (r->cursors2) {
11024 NDR_CHECK(ndr_push_drsuapi_DsReplicaCursor2Ctr(ndr, NDR_SCALARS, r->cursors2));
11026 break;
11028 case DRSUAPI_DS_REPLICA_INFO_CURSORS3:
11029 if (r->cursors3) {
11030 NDR_CHECK(ndr_push_drsuapi_DsReplicaCursor3Ctr(ndr, NDR_SCALARS|NDR_BUFFERS, r->cursors3));
11032 break;
11034 case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2:
11035 if (r->objmetadata2) {
11036 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjMetaData2Ctr(ndr, NDR_SCALARS|NDR_BUFFERS, r->objmetadata2));
11038 break;
11040 case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2:
11041 if (r->attrvalmetadata2) {
11042 NDR_CHECK(ndr_push_drsuapi_DsReplicaAttrValMetaData2Ctr(ndr, NDR_SCALARS|NDR_BUFFERS, r->attrvalmetadata2));
11044 break;
11046 case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS02:
11047 if (r->neighbours02) {
11048 NDR_CHECK(ndr_push_drsuapi_DsReplicaNeighbourCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->neighbours02));
11050 break;
11052 case DRSUAPI_DS_REPLICA_INFO_CONNECTIONS04:
11053 if (r->connections04) {
11054 NDR_CHECK(ndr_push_drsuapi_DsReplicaConnection04Ctr(ndr, NDR_SCALARS, r->connections04));
11056 break;
11058 case DRSUAPI_DS_REPLICA_INFO_CURSORS05:
11059 if (r->cursors05) {
11060 NDR_CHECK(ndr_push_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->cursors05));
11062 break;
11064 case DRSUAPI_DS_REPLICA_INFO_06:
11065 if (r->i06) {
11066 NDR_CHECK(ndr_push_drsuapi_DsReplica06Ctr(ndr, NDR_SCALARS|NDR_BUFFERS, r->i06));
11068 break;
11070 default:
11071 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
11074 return NDR_ERR_SUCCESS;
11077 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaInfo(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsReplicaInfo *r)
11079 int level;
11080 uint32_t _level;
11081 TALLOC_CTX *_mem_save_neighbours_0;
11082 TALLOC_CTX *_mem_save_cursors_0;
11083 TALLOC_CTX *_mem_save_objmetadata_0;
11084 TALLOC_CTX *_mem_save_connectfailures_0;
11085 TALLOC_CTX *_mem_save_linkfailures_0;
11086 TALLOC_CTX *_mem_save_pendingops_0;
11087 TALLOC_CTX *_mem_save_attrvalmetadata_0;
11088 TALLOC_CTX *_mem_save_cursors2_0;
11089 TALLOC_CTX *_mem_save_cursors3_0;
11090 TALLOC_CTX *_mem_save_objmetadata2_0;
11091 TALLOC_CTX *_mem_save_attrvalmetadata2_0;
11092 TALLOC_CTX *_mem_save_neighbours02_0;
11093 TALLOC_CTX *_mem_save_connections04_0;
11094 TALLOC_CTX *_mem_save_cursors05_0;
11095 TALLOC_CTX *_mem_save_i06_0;
11096 level = ndr_pull_get_switch_value(ndr, r);
11097 if (ndr_flags & NDR_SCALARS) {
11098 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
11099 if (_level != level) {
11100 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
11102 switch (level) {
11103 case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS: {
11104 uint32_t _ptr_neighbours;
11105 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_neighbours));
11106 if (_ptr_neighbours) {
11107 NDR_PULL_ALLOC(ndr, r->neighbours);
11108 } else {
11109 r->neighbours = NULL;
11111 break; }
11113 case DRSUAPI_DS_REPLICA_INFO_CURSORS: {
11114 uint32_t _ptr_cursors;
11115 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_cursors));
11116 if (_ptr_cursors) {
11117 NDR_PULL_ALLOC(ndr, r->cursors);
11118 } else {
11119 r->cursors = NULL;
11121 break; }
11123 case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA: {
11124 uint32_t _ptr_objmetadata;
11125 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_objmetadata));
11126 if (_ptr_objmetadata) {
11127 NDR_PULL_ALLOC(ndr, r->objmetadata);
11128 } else {
11129 r->objmetadata = NULL;
11131 break; }
11133 case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES: {
11134 uint32_t _ptr_connectfailures;
11135 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_connectfailures));
11136 if (_ptr_connectfailures) {
11137 NDR_PULL_ALLOC(ndr, r->connectfailures);
11138 } else {
11139 r->connectfailures = NULL;
11141 break; }
11143 case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES: {
11144 uint32_t _ptr_linkfailures;
11145 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_linkfailures));
11146 if (_ptr_linkfailures) {
11147 NDR_PULL_ALLOC(ndr, r->linkfailures);
11148 } else {
11149 r->linkfailures = NULL;
11151 break; }
11153 case DRSUAPI_DS_REPLICA_INFO_PENDING_OPS: {
11154 uint32_t _ptr_pendingops;
11155 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pendingops));
11156 if (_ptr_pendingops) {
11157 NDR_PULL_ALLOC(ndr, r->pendingops);
11158 } else {
11159 r->pendingops = NULL;
11161 break; }
11163 case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA: {
11164 uint32_t _ptr_attrvalmetadata;
11165 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_attrvalmetadata));
11166 if (_ptr_attrvalmetadata) {
11167 NDR_PULL_ALLOC(ndr, r->attrvalmetadata);
11168 } else {
11169 r->attrvalmetadata = NULL;
11171 break; }
11173 case DRSUAPI_DS_REPLICA_INFO_CURSORS2: {
11174 uint32_t _ptr_cursors2;
11175 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_cursors2));
11176 if (_ptr_cursors2) {
11177 NDR_PULL_ALLOC(ndr, r->cursors2);
11178 } else {
11179 r->cursors2 = NULL;
11181 break; }
11183 case DRSUAPI_DS_REPLICA_INFO_CURSORS3: {
11184 uint32_t _ptr_cursors3;
11185 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_cursors3));
11186 if (_ptr_cursors3) {
11187 NDR_PULL_ALLOC(ndr, r->cursors3);
11188 } else {
11189 r->cursors3 = NULL;
11191 break; }
11193 case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2: {
11194 uint32_t _ptr_objmetadata2;
11195 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_objmetadata2));
11196 if (_ptr_objmetadata2) {
11197 NDR_PULL_ALLOC(ndr, r->objmetadata2);
11198 } else {
11199 r->objmetadata2 = NULL;
11201 break; }
11203 case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2: {
11204 uint32_t _ptr_attrvalmetadata2;
11205 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_attrvalmetadata2));
11206 if (_ptr_attrvalmetadata2) {
11207 NDR_PULL_ALLOC(ndr, r->attrvalmetadata2);
11208 } else {
11209 r->attrvalmetadata2 = NULL;
11211 break; }
11213 case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS02: {
11214 uint32_t _ptr_neighbours02;
11215 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_neighbours02));
11216 if (_ptr_neighbours02) {
11217 NDR_PULL_ALLOC(ndr, r->neighbours02);
11218 } else {
11219 r->neighbours02 = NULL;
11221 break; }
11223 case DRSUAPI_DS_REPLICA_INFO_CONNECTIONS04: {
11224 uint32_t _ptr_connections04;
11225 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_connections04));
11226 if (_ptr_connections04) {
11227 NDR_PULL_ALLOC(ndr, r->connections04);
11228 } else {
11229 r->connections04 = NULL;
11231 break; }
11233 case DRSUAPI_DS_REPLICA_INFO_CURSORS05: {
11234 uint32_t _ptr_cursors05;
11235 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_cursors05));
11236 if (_ptr_cursors05) {
11237 NDR_PULL_ALLOC(ndr, r->cursors05);
11238 } else {
11239 r->cursors05 = NULL;
11241 break; }
11243 case DRSUAPI_DS_REPLICA_INFO_06: {
11244 uint32_t _ptr_i06;
11245 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_i06));
11246 if (_ptr_i06) {
11247 NDR_PULL_ALLOC(ndr, r->i06);
11248 } else {
11249 r->i06 = NULL;
11251 break; }
11253 default:
11254 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
11257 if (ndr_flags & NDR_BUFFERS) {
11258 switch (level) {
11259 case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS:
11260 if (r->neighbours) {
11261 _mem_save_neighbours_0 = NDR_PULL_GET_MEM_CTX(ndr);
11262 NDR_PULL_SET_MEM_CTX(ndr, r->neighbours, 0);
11263 NDR_CHECK(ndr_pull_drsuapi_DsReplicaNeighbourCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->neighbours));
11264 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_neighbours_0, 0);
11266 break;
11268 case DRSUAPI_DS_REPLICA_INFO_CURSORS:
11269 if (r->cursors) {
11270 _mem_save_cursors_0 = NDR_PULL_GET_MEM_CTX(ndr);
11271 NDR_PULL_SET_MEM_CTX(ndr, r->cursors, 0);
11272 NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursorCtr(ndr, NDR_SCALARS, r->cursors));
11273 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_cursors_0, 0);
11275 break;
11277 case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA:
11278 if (r->objmetadata) {
11279 _mem_save_objmetadata_0 = NDR_PULL_GET_MEM_CTX(ndr);
11280 NDR_PULL_SET_MEM_CTX(ndr, r->objmetadata, 0);
11281 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjMetaDataCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->objmetadata));
11282 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_objmetadata_0, 0);
11284 break;
11286 case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES:
11287 if (r->connectfailures) {
11288 _mem_save_connectfailures_0 = NDR_PULL_GET_MEM_CTX(ndr);
11289 NDR_PULL_SET_MEM_CTX(ndr, r->connectfailures, 0);
11290 NDR_CHECK(ndr_pull_drsuapi_DsReplicaKccDsaFailuresCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->connectfailures));
11291 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_connectfailures_0, 0);
11293 break;
11295 case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES:
11296 if (r->linkfailures) {
11297 _mem_save_linkfailures_0 = NDR_PULL_GET_MEM_CTX(ndr);
11298 NDR_PULL_SET_MEM_CTX(ndr, r->linkfailures, 0);
11299 NDR_CHECK(ndr_pull_drsuapi_DsReplicaKccDsaFailuresCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->linkfailures));
11300 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_linkfailures_0, 0);
11302 break;
11304 case DRSUAPI_DS_REPLICA_INFO_PENDING_OPS:
11305 if (r->pendingops) {
11306 _mem_save_pendingops_0 = NDR_PULL_GET_MEM_CTX(ndr);
11307 NDR_PULL_SET_MEM_CTX(ndr, r->pendingops, 0);
11308 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOpCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->pendingops));
11309 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pendingops_0, 0);
11311 break;
11313 case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA:
11314 if (r->attrvalmetadata) {
11315 _mem_save_attrvalmetadata_0 = NDR_PULL_GET_MEM_CTX(ndr);
11316 NDR_PULL_SET_MEM_CTX(ndr, r->attrvalmetadata, 0);
11317 NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttrValMetaDataCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->attrvalmetadata));
11318 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attrvalmetadata_0, 0);
11320 break;
11322 case DRSUAPI_DS_REPLICA_INFO_CURSORS2:
11323 if (r->cursors2) {
11324 _mem_save_cursors2_0 = NDR_PULL_GET_MEM_CTX(ndr);
11325 NDR_PULL_SET_MEM_CTX(ndr, r->cursors2, 0);
11326 NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursor2Ctr(ndr, NDR_SCALARS, r->cursors2));
11327 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_cursors2_0, 0);
11329 break;
11331 case DRSUAPI_DS_REPLICA_INFO_CURSORS3:
11332 if (r->cursors3) {
11333 _mem_save_cursors3_0 = NDR_PULL_GET_MEM_CTX(ndr);
11334 NDR_PULL_SET_MEM_CTX(ndr, r->cursors3, 0);
11335 NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursor3Ctr(ndr, NDR_SCALARS|NDR_BUFFERS, r->cursors3));
11336 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_cursors3_0, 0);
11338 break;
11340 case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2:
11341 if (r->objmetadata2) {
11342 _mem_save_objmetadata2_0 = NDR_PULL_GET_MEM_CTX(ndr);
11343 NDR_PULL_SET_MEM_CTX(ndr, r->objmetadata2, 0);
11344 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjMetaData2Ctr(ndr, NDR_SCALARS|NDR_BUFFERS, r->objmetadata2));
11345 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_objmetadata2_0, 0);
11347 break;
11349 case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2:
11350 if (r->attrvalmetadata2) {
11351 _mem_save_attrvalmetadata2_0 = NDR_PULL_GET_MEM_CTX(ndr);
11352 NDR_PULL_SET_MEM_CTX(ndr, r->attrvalmetadata2, 0);
11353 NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttrValMetaData2Ctr(ndr, NDR_SCALARS|NDR_BUFFERS, r->attrvalmetadata2));
11354 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attrvalmetadata2_0, 0);
11356 break;
11358 case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS02:
11359 if (r->neighbours02) {
11360 _mem_save_neighbours02_0 = NDR_PULL_GET_MEM_CTX(ndr);
11361 NDR_PULL_SET_MEM_CTX(ndr, r->neighbours02, 0);
11362 NDR_CHECK(ndr_pull_drsuapi_DsReplicaNeighbourCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->neighbours02));
11363 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_neighbours02_0, 0);
11365 break;
11367 case DRSUAPI_DS_REPLICA_INFO_CONNECTIONS04:
11368 if (r->connections04) {
11369 _mem_save_connections04_0 = NDR_PULL_GET_MEM_CTX(ndr);
11370 NDR_PULL_SET_MEM_CTX(ndr, r->connections04, 0);
11371 NDR_CHECK(ndr_pull_drsuapi_DsReplicaConnection04Ctr(ndr, NDR_SCALARS, r->connections04));
11372 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_connections04_0, 0);
11374 break;
11376 case DRSUAPI_DS_REPLICA_INFO_CURSORS05:
11377 if (r->cursors05) {
11378 _mem_save_cursors05_0 = NDR_PULL_GET_MEM_CTX(ndr);
11379 NDR_PULL_SET_MEM_CTX(ndr, r->cursors05, 0);
11380 NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->cursors05));
11381 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_cursors05_0, 0);
11383 break;
11385 case DRSUAPI_DS_REPLICA_INFO_06:
11386 if (r->i06) {
11387 _mem_save_i06_0 = NDR_PULL_GET_MEM_CTX(ndr);
11388 NDR_PULL_SET_MEM_CTX(ndr, r->i06, 0);
11389 NDR_CHECK(ndr_pull_drsuapi_DsReplica06Ctr(ndr, NDR_SCALARS|NDR_BUFFERS, r->i06));
11390 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_i06_0, 0);
11392 break;
11394 default:
11395 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
11398 return NDR_ERR_SUCCESS;
11401 _PUBLIC_ void ndr_print_drsuapi_DsReplicaInfo(struct ndr_print *ndr, const char *name, const union drsuapi_DsReplicaInfo *r)
11403 int level;
11404 level = ndr_print_get_switch_value(ndr, r);
11405 ndr_print_union(ndr, name, level, "drsuapi_DsReplicaInfo");
11406 switch (level) {
11407 case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS:
11408 ndr_print_ptr(ndr, "neighbours", r->neighbours);
11409 ndr->depth++;
11410 if (r->neighbours) {
11411 ndr_print_drsuapi_DsReplicaNeighbourCtr(ndr, "neighbours", r->neighbours);
11413 ndr->depth--;
11414 break;
11416 case DRSUAPI_DS_REPLICA_INFO_CURSORS:
11417 ndr_print_ptr(ndr, "cursors", r->cursors);
11418 ndr->depth++;
11419 if (r->cursors) {
11420 ndr_print_drsuapi_DsReplicaCursorCtr(ndr, "cursors", r->cursors);
11422 ndr->depth--;
11423 break;
11425 case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA:
11426 ndr_print_ptr(ndr, "objmetadata", r->objmetadata);
11427 ndr->depth++;
11428 if (r->objmetadata) {
11429 ndr_print_drsuapi_DsReplicaObjMetaDataCtr(ndr, "objmetadata", r->objmetadata);
11431 ndr->depth--;
11432 break;
11434 case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES:
11435 ndr_print_ptr(ndr, "connectfailures", r->connectfailures);
11436 ndr->depth++;
11437 if (r->connectfailures) {
11438 ndr_print_drsuapi_DsReplicaKccDsaFailuresCtr(ndr, "connectfailures", r->connectfailures);
11440 ndr->depth--;
11441 break;
11443 case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES:
11444 ndr_print_ptr(ndr, "linkfailures", r->linkfailures);
11445 ndr->depth++;
11446 if (r->linkfailures) {
11447 ndr_print_drsuapi_DsReplicaKccDsaFailuresCtr(ndr, "linkfailures", r->linkfailures);
11449 ndr->depth--;
11450 break;
11452 case DRSUAPI_DS_REPLICA_INFO_PENDING_OPS:
11453 ndr_print_ptr(ndr, "pendingops", r->pendingops);
11454 ndr->depth++;
11455 if (r->pendingops) {
11456 ndr_print_drsuapi_DsReplicaOpCtr(ndr, "pendingops", r->pendingops);
11458 ndr->depth--;
11459 break;
11461 case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA:
11462 ndr_print_ptr(ndr, "attrvalmetadata", r->attrvalmetadata);
11463 ndr->depth++;
11464 if (r->attrvalmetadata) {
11465 ndr_print_drsuapi_DsReplicaAttrValMetaDataCtr(ndr, "attrvalmetadata", r->attrvalmetadata);
11467 ndr->depth--;
11468 break;
11470 case DRSUAPI_DS_REPLICA_INFO_CURSORS2:
11471 ndr_print_ptr(ndr, "cursors2", r->cursors2);
11472 ndr->depth++;
11473 if (r->cursors2) {
11474 ndr_print_drsuapi_DsReplicaCursor2Ctr(ndr, "cursors2", r->cursors2);
11476 ndr->depth--;
11477 break;
11479 case DRSUAPI_DS_REPLICA_INFO_CURSORS3:
11480 ndr_print_ptr(ndr, "cursors3", r->cursors3);
11481 ndr->depth++;
11482 if (r->cursors3) {
11483 ndr_print_drsuapi_DsReplicaCursor3Ctr(ndr, "cursors3", r->cursors3);
11485 ndr->depth--;
11486 break;
11488 case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2:
11489 ndr_print_ptr(ndr, "objmetadata2", r->objmetadata2);
11490 ndr->depth++;
11491 if (r->objmetadata2) {
11492 ndr_print_drsuapi_DsReplicaObjMetaData2Ctr(ndr, "objmetadata2", r->objmetadata2);
11494 ndr->depth--;
11495 break;
11497 case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2:
11498 ndr_print_ptr(ndr, "attrvalmetadata2", r->attrvalmetadata2);
11499 ndr->depth++;
11500 if (r->attrvalmetadata2) {
11501 ndr_print_drsuapi_DsReplicaAttrValMetaData2Ctr(ndr, "attrvalmetadata2", r->attrvalmetadata2);
11503 ndr->depth--;
11504 break;
11506 case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS02:
11507 ndr_print_ptr(ndr, "neighbours02", r->neighbours02);
11508 ndr->depth++;
11509 if (r->neighbours02) {
11510 ndr_print_drsuapi_DsReplicaNeighbourCtr(ndr, "neighbours02", r->neighbours02);
11512 ndr->depth--;
11513 break;
11515 case DRSUAPI_DS_REPLICA_INFO_CONNECTIONS04:
11516 ndr_print_ptr(ndr, "connections04", r->connections04);
11517 ndr->depth++;
11518 if (r->connections04) {
11519 ndr_print_drsuapi_DsReplicaConnection04Ctr(ndr, "connections04", r->connections04);
11521 ndr->depth--;
11522 break;
11524 case DRSUAPI_DS_REPLICA_INFO_CURSORS05:
11525 ndr_print_ptr(ndr, "cursors05", r->cursors05);
11526 ndr->depth++;
11527 if (r->cursors05) {
11528 ndr_print_drsuapi_DsReplicaCursorCtrEx(ndr, "cursors05", r->cursors05);
11530 ndr->depth--;
11531 break;
11533 case DRSUAPI_DS_REPLICA_INFO_06:
11534 ndr_print_ptr(ndr, "i06", r->i06);
11535 ndr->depth++;
11536 if (r->i06) {
11537 ndr_print_drsuapi_DsReplica06Ctr(ndr, "i06", r->i06);
11539 ndr->depth--;
11540 break;
11542 default:
11543 ndr_print_bad_level(ndr, name, level);
11547 static enum ndr_err_code ndr_push_drsuapi_DsGetMemberships2Ctr(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetMemberships2Ctr *r)
11549 if (ndr_flags & NDR_SCALARS) {
11550 int level = ndr_push_get_switch_value(ndr, r);
11551 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
11552 switch (level) {
11553 case 1: {
11554 NDR_CHECK(ndr_push_drsuapi_DsGetMembershipsCtr1(ndr, NDR_SCALARS, &r->ctr1));
11555 break; }
11557 default:
11558 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
11561 if (ndr_flags & NDR_BUFFERS) {
11562 int level = ndr_push_get_switch_value(ndr, r);
11563 switch (level) {
11564 case 1:
11565 NDR_CHECK(ndr_push_drsuapi_DsGetMembershipsCtr1(ndr, NDR_BUFFERS, &r->ctr1));
11566 break;
11568 default:
11569 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
11572 return NDR_ERR_SUCCESS;
11575 static enum ndr_err_code ndr_pull_drsuapi_DsGetMemberships2Ctr(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetMemberships2Ctr *r)
11577 int level;
11578 int32_t _level;
11579 level = ndr_pull_get_switch_value(ndr, r);
11580 if (ndr_flags & NDR_SCALARS) {
11581 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
11582 if (_level != level) {
11583 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
11585 switch (level) {
11586 case 1: {
11587 NDR_CHECK(ndr_pull_drsuapi_DsGetMembershipsCtr1(ndr, NDR_SCALARS, &r->ctr1));
11588 break; }
11590 default:
11591 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
11594 if (ndr_flags & NDR_BUFFERS) {
11595 switch (level) {
11596 case 1:
11597 NDR_CHECK(ndr_pull_drsuapi_DsGetMembershipsCtr1(ndr, NDR_BUFFERS, &r->ctr1));
11598 break;
11600 default:
11601 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
11604 return NDR_ERR_SUCCESS;
11607 _PUBLIC_ void ndr_print_drsuapi_DsGetMemberships2Ctr(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetMemberships2Ctr *r)
11609 int level;
11610 level = ndr_print_get_switch_value(ndr, r);
11611 ndr_print_union(ndr, name, level, "drsuapi_DsGetMemberships2Ctr");
11612 switch (level) {
11613 case 1:
11614 ndr_print_drsuapi_DsGetMembershipsCtr1(ndr, "ctr1", &r->ctr1);
11615 break;
11617 default:
11618 ndr_print_bad_level(ndr, name, level);
11622 static enum ndr_err_code ndr_push_drsuapi_DsGetMemberships2Request1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetMemberships2Request1 *r)
11624 uint32_t cntr_req_array_1;
11625 if (ndr_flags & NDR_SCALARS) {
11626 NDR_CHECK(ndr_push_align(ndr, 4));
11627 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_req));
11628 NDR_CHECK(ndr_push_unique_ptr(ndr, r->req_array));
11630 if (ndr_flags & NDR_BUFFERS) {
11631 if (r->req_array) {
11632 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_req));
11633 for (cntr_req_array_1 = 0; cntr_req_array_1 < r->num_req; cntr_req_array_1++) {
11634 NDR_CHECK(ndr_push_unique_ptr(ndr, r->req_array[cntr_req_array_1]));
11636 for (cntr_req_array_1 = 0; cntr_req_array_1 < r->num_req; cntr_req_array_1++) {
11637 if (r->req_array[cntr_req_array_1]) {
11638 NDR_CHECK(ndr_push_drsuapi_DsGetMembershipsRequest1(ndr, NDR_SCALARS|NDR_BUFFERS, r->req_array[cntr_req_array_1]));
11643 return NDR_ERR_SUCCESS;
11646 static enum ndr_err_code ndr_pull_drsuapi_DsGetMemberships2Request1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetMemberships2Request1 *r)
11648 uint32_t _ptr_req_array;
11649 uint32_t cntr_req_array_1;
11650 TALLOC_CTX *_mem_save_req_array_0;
11651 TALLOC_CTX *_mem_save_req_array_1;
11652 TALLOC_CTX *_mem_save_req_array_2;
11653 if (ndr_flags & NDR_SCALARS) {
11654 NDR_CHECK(ndr_pull_align(ndr, 4));
11655 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_req));
11656 if (r->num_req < 1 || r->num_req > 10000) {
11657 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
11659 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_req_array));
11660 if (_ptr_req_array) {
11661 NDR_PULL_ALLOC(ndr, r->req_array);
11662 } else {
11663 r->req_array = NULL;
11666 if (ndr_flags & NDR_BUFFERS) {
11667 if (r->req_array) {
11668 _mem_save_req_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
11669 NDR_PULL_SET_MEM_CTX(ndr, r->req_array, 0);
11670 NDR_CHECK(ndr_pull_array_size(ndr, &r->req_array));
11671 NDR_PULL_ALLOC_N(ndr, r->req_array, ndr_get_array_size(ndr, &r->req_array));
11672 _mem_save_req_array_1 = NDR_PULL_GET_MEM_CTX(ndr);
11673 NDR_PULL_SET_MEM_CTX(ndr, r->req_array, 0);
11674 for (cntr_req_array_1 = 0; cntr_req_array_1 < r->num_req; cntr_req_array_1++) {
11675 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_req_array));
11676 if (_ptr_req_array) {
11677 NDR_PULL_ALLOC(ndr, r->req_array[cntr_req_array_1]);
11678 } else {
11679 r->req_array[cntr_req_array_1] = NULL;
11682 for (cntr_req_array_1 = 0; cntr_req_array_1 < r->num_req; cntr_req_array_1++) {
11683 if (r->req_array[cntr_req_array_1]) {
11684 _mem_save_req_array_2 = NDR_PULL_GET_MEM_CTX(ndr);
11685 NDR_PULL_SET_MEM_CTX(ndr, r->req_array[cntr_req_array_1], 0);
11686 NDR_CHECK(ndr_pull_drsuapi_DsGetMembershipsRequest1(ndr, NDR_SCALARS|NDR_BUFFERS, r->req_array[cntr_req_array_1]));
11687 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_array_2, 0);
11690 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_array_1, 0);
11691 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_array_0, 0);
11693 if (r->req_array) {
11694 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->req_array, r->num_req));
11697 return NDR_ERR_SUCCESS;
11700 _PUBLIC_ void ndr_print_drsuapi_DsGetMemberships2Request1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetMemberships2Request1 *r)
11702 uint32_t cntr_req_array_1;
11703 ndr_print_struct(ndr, name, "drsuapi_DsGetMemberships2Request1");
11704 ndr->depth++;
11705 ndr_print_uint32(ndr, "num_req", r->num_req);
11706 ndr_print_ptr(ndr, "req_array", r->req_array);
11707 ndr->depth++;
11708 if (r->req_array) {
11709 ndr->print(ndr, "%s: ARRAY(%d)", "req_array", (int)r->num_req);
11710 ndr->depth++;
11711 for (cntr_req_array_1=0;cntr_req_array_1<r->num_req;cntr_req_array_1++) {
11712 char *idx_1=NULL;
11713 if (asprintf(&idx_1, "[%d]", cntr_req_array_1) != -1) {
11714 ndr_print_ptr(ndr, "req_array", r->req_array[cntr_req_array_1]);
11715 ndr->depth++;
11716 if (r->req_array[cntr_req_array_1]) {
11717 ndr_print_drsuapi_DsGetMembershipsRequest1(ndr, "req_array", r->req_array[cntr_req_array_1]);
11719 ndr->depth--;
11720 free(idx_1);
11723 ndr->depth--;
11725 ndr->depth--;
11726 ndr->depth--;
11729 static enum ndr_err_code ndr_push_drsuapi_DsGetMemberships2Request(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetMemberships2Request *r)
11731 if (ndr_flags & NDR_SCALARS) {
11732 int level = ndr_push_get_switch_value(ndr, r);
11733 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
11734 switch (level) {
11735 case 1: {
11736 NDR_CHECK(ndr_push_drsuapi_DsGetMemberships2Request1(ndr, NDR_SCALARS, &r->req1));
11737 break; }
11739 default:
11740 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
11743 if (ndr_flags & NDR_BUFFERS) {
11744 int level = ndr_push_get_switch_value(ndr, r);
11745 switch (level) {
11746 case 1:
11747 NDR_CHECK(ndr_push_drsuapi_DsGetMemberships2Request1(ndr, NDR_BUFFERS, &r->req1));
11748 break;
11750 default:
11751 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
11754 return NDR_ERR_SUCCESS;
11757 static enum ndr_err_code ndr_pull_drsuapi_DsGetMemberships2Request(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetMemberships2Request *r)
11759 int level;
11760 int32_t _level;
11761 level = ndr_pull_get_switch_value(ndr, r);
11762 if (ndr_flags & NDR_SCALARS) {
11763 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
11764 if (_level != level) {
11765 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
11767 switch (level) {
11768 case 1: {
11769 NDR_CHECK(ndr_pull_drsuapi_DsGetMemberships2Request1(ndr, NDR_SCALARS, &r->req1));
11770 break; }
11772 default:
11773 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
11776 if (ndr_flags & NDR_BUFFERS) {
11777 switch (level) {
11778 case 1:
11779 NDR_CHECK(ndr_pull_drsuapi_DsGetMemberships2Request1(ndr, NDR_BUFFERS, &r->req1));
11780 break;
11782 default:
11783 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
11786 return NDR_ERR_SUCCESS;
11789 _PUBLIC_ void ndr_print_drsuapi_DsGetMemberships2Request(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetMemberships2Request *r)
11791 int level;
11792 level = ndr_print_get_switch_value(ndr, r);
11793 ndr_print_union(ndr, name, level, "drsuapi_DsGetMemberships2Request");
11794 switch (level) {
11795 case 1:
11796 ndr_print_drsuapi_DsGetMemberships2Request1(ndr, "req1", &r->req1);
11797 break;
11799 default:
11800 ndr_print_bad_level(ndr, name, level);
11804 static enum ndr_err_code ndr_push_drsuapi_DsSiteCostInfo(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsSiteCostInfo *r)
11806 if (ndr_flags & NDR_SCALARS) {
11807 NDR_CHECK(ndr_push_align(ndr, 4));
11808 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->error_code));
11809 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->site_cost));
11811 if (ndr_flags & NDR_BUFFERS) {
11813 return NDR_ERR_SUCCESS;
11816 static enum ndr_err_code ndr_pull_drsuapi_DsSiteCostInfo(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsSiteCostInfo *r)
11818 if (ndr_flags & NDR_SCALARS) {
11819 NDR_CHECK(ndr_pull_align(ndr, 4));
11820 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->error_code));
11821 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->site_cost));
11823 if (ndr_flags & NDR_BUFFERS) {
11825 return NDR_ERR_SUCCESS;
11828 _PUBLIC_ void ndr_print_drsuapi_DsSiteCostInfo(struct ndr_print *ndr, const char *name, const struct drsuapi_DsSiteCostInfo *r)
11830 ndr_print_struct(ndr, name, "drsuapi_DsSiteCostInfo");
11831 ndr->depth++;
11832 ndr_print_WERROR(ndr, "error_code", r->error_code);
11833 ndr_print_uint32(ndr, "site_cost", r->site_cost);
11834 ndr->depth--;
11837 static enum ndr_err_code ndr_push_drsuapi_QuerySitesByCostCtr1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_QuerySitesByCostCtr1 *r)
11839 uint32_t cntr_info_1;
11840 if (ndr_flags & NDR_SCALARS) {
11841 NDR_CHECK(ndr_push_align(ndr, 4));
11842 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_info));
11843 NDR_CHECK(ndr_push_unique_ptr(ndr, r->info));
11844 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown));
11846 if (ndr_flags & NDR_BUFFERS) {
11847 if (r->info) {
11848 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_info));
11849 for (cntr_info_1 = 0; cntr_info_1 < r->num_info; cntr_info_1++) {
11850 NDR_CHECK(ndr_push_drsuapi_DsSiteCostInfo(ndr, NDR_SCALARS, &r->info[cntr_info_1]));
11854 return NDR_ERR_SUCCESS;
11857 static enum ndr_err_code ndr_pull_drsuapi_QuerySitesByCostCtr1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_QuerySitesByCostCtr1 *r)
11859 uint32_t _ptr_info;
11860 uint32_t cntr_info_1;
11861 TALLOC_CTX *_mem_save_info_0;
11862 TALLOC_CTX *_mem_save_info_1;
11863 if (ndr_flags & NDR_SCALARS) {
11864 NDR_CHECK(ndr_pull_align(ndr, 4));
11865 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_info));
11866 if (r->num_info > 10000) {
11867 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
11869 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info));
11870 if (_ptr_info) {
11871 NDR_PULL_ALLOC(ndr, r->info);
11872 } else {
11873 r->info = NULL;
11875 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown));
11877 if (ndr_flags & NDR_BUFFERS) {
11878 if (r->info) {
11879 _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
11880 NDR_PULL_SET_MEM_CTX(ndr, r->info, 0);
11881 NDR_CHECK(ndr_pull_array_size(ndr, &r->info));
11882 NDR_PULL_ALLOC_N(ndr, r->info, ndr_get_array_size(ndr, &r->info));
11883 _mem_save_info_1 = NDR_PULL_GET_MEM_CTX(ndr);
11884 NDR_PULL_SET_MEM_CTX(ndr, r->info, 0);
11885 for (cntr_info_1 = 0; cntr_info_1 < r->num_info; cntr_info_1++) {
11886 NDR_CHECK(ndr_pull_drsuapi_DsSiteCostInfo(ndr, NDR_SCALARS, &r->info[cntr_info_1]));
11888 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_1, 0);
11889 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0);
11891 if (r->info) {
11892 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->info, r->num_info));
11895 return NDR_ERR_SUCCESS;
11898 _PUBLIC_ void ndr_print_drsuapi_QuerySitesByCostCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_QuerySitesByCostCtr1 *r)
11900 uint32_t cntr_info_1;
11901 ndr_print_struct(ndr, name, "drsuapi_QuerySitesByCostCtr1");
11902 ndr->depth++;
11903 ndr_print_uint32(ndr, "num_info", r->num_info);
11904 ndr_print_ptr(ndr, "info", r->info);
11905 ndr->depth++;
11906 if (r->info) {
11907 ndr->print(ndr, "%s: ARRAY(%d)", "info", (int)r->num_info);
11908 ndr->depth++;
11909 for (cntr_info_1=0;cntr_info_1<r->num_info;cntr_info_1++) {
11910 char *idx_1=NULL;
11911 if (asprintf(&idx_1, "[%d]", cntr_info_1) != -1) {
11912 ndr_print_drsuapi_DsSiteCostInfo(ndr, "info", &r->info[cntr_info_1]);
11913 free(idx_1);
11916 ndr->depth--;
11918 ndr->depth--;
11919 ndr_print_uint32(ndr, "unknown", r->unknown);
11920 ndr->depth--;
11923 static enum ndr_err_code ndr_push_drsuapi_QuerySitesByCostCtr(struct ndr_push *ndr, int ndr_flags, const union drsuapi_QuerySitesByCostCtr *r)
11925 if (ndr_flags & NDR_SCALARS) {
11926 int level = ndr_push_get_switch_value(ndr, r);
11927 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
11928 switch (level) {
11929 case 1: {
11930 NDR_CHECK(ndr_push_drsuapi_QuerySitesByCostCtr1(ndr, NDR_SCALARS, &r->ctr1));
11931 break; }
11933 default:
11934 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
11937 if (ndr_flags & NDR_BUFFERS) {
11938 int level = ndr_push_get_switch_value(ndr, r);
11939 switch (level) {
11940 case 1:
11941 NDR_CHECK(ndr_push_drsuapi_QuerySitesByCostCtr1(ndr, NDR_BUFFERS, &r->ctr1));
11942 break;
11944 default:
11945 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
11948 return NDR_ERR_SUCCESS;
11951 static enum ndr_err_code ndr_pull_drsuapi_QuerySitesByCostCtr(struct ndr_pull *ndr, int ndr_flags, union drsuapi_QuerySitesByCostCtr *r)
11953 int level;
11954 int32_t _level;
11955 level = ndr_pull_get_switch_value(ndr, r);
11956 if (ndr_flags & NDR_SCALARS) {
11957 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
11958 if (_level != level) {
11959 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
11961 switch (level) {
11962 case 1: {
11963 NDR_CHECK(ndr_pull_drsuapi_QuerySitesByCostCtr1(ndr, NDR_SCALARS, &r->ctr1));
11964 break; }
11966 default:
11967 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
11970 if (ndr_flags & NDR_BUFFERS) {
11971 switch (level) {
11972 case 1:
11973 NDR_CHECK(ndr_pull_drsuapi_QuerySitesByCostCtr1(ndr, NDR_BUFFERS, &r->ctr1));
11974 break;
11976 default:
11977 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
11980 return NDR_ERR_SUCCESS;
11983 _PUBLIC_ void ndr_print_drsuapi_QuerySitesByCostCtr(struct ndr_print *ndr, const char *name, const union drsuapi_QuerySitesByCostCtr *r)
11985 int level;
11986 level = ndr_print_get_switch_value(ndr, r);
11987 ndr_print_union(ndr, name, level, "drsuapi_QuerySitesByCostCtr");
11988 switch (level) {
11989 case 1:
11990 ndr_print_drsuapi_QuerySitesByCostCtr1(ndr, "ctr1", &r->ctr1);
11991 break;
11993 default:
11994 ndr_print_bad_level(ndr, name, level);
11998 static enum ndr_err_code ndr_push_drsuapi_QuerySitesByCostRequest1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_QuerySitesByCostRequest1 *r)
12000 uint32_t cntr_site_to_1;
12001 if (ndr_flags & NDR_SCALARS) {
12002 NDR_CHECK(ndr_push_align(ndr, 4));
12003 NDR_CHECK(ndr_push_unique_ptr(ndr, r->site_from));
12004 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_req));
12005 NDR_CHECK(ndr_push_unique_ptr(ndr, r->site_to));
12006 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->flags));
12008 if (ndr_flags & NDR_BUFFERS) {
12009 if (r->site_from) {
12010 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->site_from, CH_UTF16)));
12011 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
12012 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->site_from, CH_UTF16)));
12013 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->site_from, ndr_charset_length(r->site_from, CH_UTF16), sizeof(uint16_t), CH_UTF16));
12015 if (r->site_to) {
12016 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_req));
12017 for (cntr_site_to_1 = 0; cntr_site_to_1 < r->num_req; cntr_site_to_1++) {
12018 NDR_CHECK(ndr_push_unique_ptr(ndr, r->site_to[cntr_site_to_1]));
12020 for (cntr_site_to_1 = 0; cntr_site_to_1 < r->num_req; cntr_site_to_1++) {
12021 if (r->site_to[cntr_site_to_1]) {
12022 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->site_to[cntr_site_to_1], CH_UTF16)));
12023 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
12024 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->site_to[cntr_site_to_1], CH_UTF16)));
12025 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));
12030 return NDR_ERR_SUCCESS;
12033 static enum ndr_err_code ndr_pull_drsuapi_QuerySitesByCostRequest1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_QuerySitesByCostRequest1 *r)
12035 uint32_t _ptr_site_from;
12036 TALLOC_CTX *_mem_save_site_from_0;
12037 uint32_t _ptr_site_to;
12038 uint32_t cntr_site_to_1;
12039 TALLOC_CTX *_mem_save_site_to_0;
12040 TALLOC_CTX *_mem_save_site_to_1;
12041 TALLOC_CTX *_mem_save_site_to_2;
12042 if (ndr_flags & NDR_SCALARS) {
12043 NDR_CHECK(ndr_pull_align(ndr, 4));
12044 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_from));
12045 if (_ptr_site_from) {
12046 NDR_PULL_ALLOC(ndr, r->site_from);
12047 } else {
12048 r->site_from = NULL;
12050 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_req));
12051 if (r->num_req < 1 || r->num_req > 10000) {
12052 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
12054 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_to));
12055 if (_ptr_site_to) {
12056 NDR_PULL_ALLOC(ndr, r->site_to);
12057 } else {
12058 r->site_to = NULL;
12060 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->flags));
12062 if (ndr_flags & NDR_BUFFERS) {
12063 if (r->site_from) {
12064 _mem_save_site_from_0 = NDR_PULL_GET_MEM_CTX(ndr);
12065 NDR_PULL_SET_MEM_CTX(ndr, r->site_from, 0);
12066 NDR_CHECK(ndr_pull_array_size(ndr, &r->site_from));
12067 NDR_CHECK(ndr_pull_array_length(ndr, &r->site_from));
12068 if (ndr_get_array_length(ndr, &r->site_from) > ndr_get_array_size(ndr, &r->site_from)) {
12069 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));
12071 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->site_from), sizeof(uint16_t)));
12072 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->site_from, ndr_get_array_length(ndr, &r->site_from), sizeof(uint16_t), CH_UTF16));
12073 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_from_0, 0);
12075 if (r->site_to) {
12076 _mem_save_site_to_0 = NDR_PULL_GET_MEM_CTX(ndr);
12077 NDR_PULL_SET_MEM_CTX(ndr, r->site_to, 0);
12078 NDR_CHECK(ndr_pull_array_size(ndr, &r->site_to));
12079 NDR_PULL_ALLOC_N(ndr, r->site_to, ndr_get_array_size(ndr, &r->site_to));
12080 _mem_save_site_to_1 = NDR_PULL_GET_MEM_CTX(ndr);
12081 NDR_PULL_SET_MEM_CTX(ndr, r->site_to, 0);
12082 for (cntr_site_to_1 = 0; cntr_site_to_1 < r->num_req; cntr_site_to_1++) {
12083 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_to));
12084 if (_ptr_site_to) {
12085 NDR_PULL_ALLOC(ndr, r->site_to[cntr_site_to_1]);
12086 } else {
12087 r->site_to[cntr_site_to_1] = NULL;
12090 for (cntr_site_to_1 = 0; cntr_site_to_1 < r->num_req; cntr_site_to_1++) {
12091 if (r->site_to[cntr_site_to_1]) {
12092 _mem_save_site_to_2 = NDR_PULL_GET_MEM_CTX(ndr);
12093 NDR_PULL_SET_MEM_CTX(ndr, r->site_to[cntr_site_to_1], 0);
12094 NDR_CHECK(ndr_pull_array_size(ndr, &r->site_to[cntr_site_to_1]));
12095 NDR_CHECK(ndr_pull_array_length(ndr, &r->site_to[cntr_site_to_1]));
12096 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])) {
12097 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]));
12099 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->site_to[cntr_site_to_1]), sizeof(uint16_t)));
12100 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));
12101 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_to_2, 0);
12104 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_to_1, 0);
12105 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_to_0, 0);
12107 if (r->site_to) {
12108 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->site_to, r->num_req));
12111 return NDR_ERR_SUCCESS;
12114 _PUBLIC_ void ndr_print_drsuapi_QuerySitesByCostRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_QuerySitesByCostRequest1 *r)
12116 uint32_t cntr_site_to_1;
12117 ndr_print_struct(ndr, name, "drsuapi_QuerySitesByCostRequest1");
12118 ndr->depth++;
12119 ndr_print_ptr(ndr, "site_from", r->site_from);
12120 ndr->depth++;
12121 if (r->site_from) {
12122 ndr_print_string(ndr, "site_from", r->site_from);
12124 ndr->depth--;
12125 ndr_print_uint32(ndr, "num_req", r->num_req);
12126 ndr_print_ptr(ndr, "site_to", r->site_to);
12127 ndr->depth++;
12128 if (r->site_to) {
12129 ndr->print(ndr, "%s: ARRAY(%d)", "site_to", (int)r->num_req);
12130 ndr->depth++;
12131 for (cntr_site_to_1=0;cntr_site_to_1<r->num_req;cntr_site_to_1++) {
12132 char *idx_1=NULL;
12133 if (asprintf(&idx_1, "[%d]", cntr_site_to_1) != -1) {
12134 ndr_print_ptr(ndr, "site_to", r->site_to[cntr_site_to_1]);
12135 ndr->depth++;
12136 if (r->site_to[cntr_site_to_1]) {
12137 ndr_print_string(ndr, "site_to", r->site_to[cntr_site_to_1]);
12139 ndr->depth--;
12140 free(idx_1);
12143 ndr->depth--;
12145 ndr->depth--;
12146 ndr_print_uint32(ndr, "flags", r->flags);
12147 ndr->depth--;
12150 static enum ndr_err_code ndr_push_drsuapi_QuerySitesByCostRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_QuerySitesByCostRequest *r)
12152 if (ndr_flags & NDR_SCALARS) {
12153 int level = ndr_push_get_switch_value(ndr, r);
12154 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
12155 switch (level) {
12156 case 1: {
12157 NDR_CHECK(ndr_push_drsuapi_QuerySitesByCostRequest1(ndr, NDR_SCALARS, &r->req1));
12158 break; }
12160 default:
12161 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
12164 if (ndr_flags & NDR_BUFFERS) {
12165 int level = ndr_push_get_switch_value(ndr, r);
12166 switch (level) {
12167 case 1:
12168 NDR_CHECK(ndr_push_drsuapi_QuerySitesByCostRequest1(ndr, NDR_BUFFERS, &r->req1));
12169 break;
12171 default:
12172 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
12175 return NDR_ERR_SUCCESS;
12178 static enum ndr_err_code ndr_pull_drsuapi_QuerySitesByCostRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_QuerySitesByCostRequest *r)
12180 int level;
12181 int32_t _level;
12182 level = ndr_pull_get_switch_value(ndr, r);
12183 if (ndr_flags & NDR_SCALARS) {
12184 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
12185 if (_level != level) {
12186 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
12188 switch (level) {
12189 case 1: {
12190 NDR_CHECK(ndr_pull_drsuapi_QuerySitesByCostRequest1(ndr, NDR_SCALARS, &r->req1));
12191 break; }
12193 default:
12194 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
12197 if (ndr_flags & NDR_BUFFERS) {
12198 switch (level) {
12199 case 1:
12200 NDR_CHECK(ndr_pull_drsuapi_QuerySitesByCostRequest1(ndr, NDR_BUFFERS, &r->req1));
12201 break;
12203 default:
12204 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
12207 return NDR_ERR_SUCCESS;
12210 _PUBLIC_ void ndr_print_drsuapi_QuerySitesByCostRequest(struct ndr_print *ndr, const char *name, const union drsuapi_QuerySitesByCostRequest *r)
12212 int level;
12213 level = ndr_print_get_switch_value(ndr, r);
12214 ndr_print_union(ndr, name, level, "drsuapi_QuerySitesByCostRequest");
12215 switch (level) {
12216 case 1:
12217 ndr_print_drsuapi_QuerySitesByCostRequest1(ndr, "req1", &r->req1);
12218 break;
12220 default:
12221 ndr_print_bad_level(ndr, name, level);
12225 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsBind(struct ndr_push *ndr, int flags, const struct drsuapi_DsBind *r)
12227 if (flags & NDR_IN) {
12228 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.bind_guid));
12229 if (r->in.bind_guid) {
12230 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->in.bind_guid));
12232 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.bind_info));
12233 if (r->in.bind_info) {
12234 NDR_CHECK(ndr_push_drsuapi_DsBindInfoCtr(ndr, NDR_SCALARS, r->in.bind_info));
12237 if (flags & NDR_OUT) {
12238 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.bind_info));
12239 if (r->out.bind_info) {
12240 NDR_CHECK(ndr_push_drsuapi_DsBindInfoCtr(ndr, NDR_SCALARS, r->out.bind_info));
12242 if (r->out.bind_handle == NULL) {
12243 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12245 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.bind_handle));
12246 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
12248 return NDR_ERR_SUCCESS;
12251 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsBind(struct ndr_pull *ndr, int flags, struct drsuapi_DsBind *r)
12253 uint32_t _ptr_bind_guid;
12254 uint32_t _ptr_bind_info;
12255 TALLOC_CTX *_mem_save_bind_guid_0;
12256 TALLOC_CTX *_mem_save_bind_info_0;
12257 TALLOC_CTX *_mem_save_bind_handle_0;
12258 if (flags & NDR_IN) {
12259 ZERO_STRUCT(r->out);
12261 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_bind_guid));
12262 if (_ptr_bind_guid) {
12263 NDR_PULL_ALLOC(ndr, r->in.bind_guid);
12264 } else {
12265 r->in.bind_guid = NULL;
12267 if (r->in.bind_guid) {
12268 _mem_save_bind_guid_0 = NDR_PULL_GET_MEM_CTX(ndr);
12269 NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_guid, 0);
12270 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, r->in.bind_guid));
12271 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_guid_0, 0);
12273 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_bind_info));
12274 if (_ptr_bind_info) {
12275 NDR_PULL_ALLOC(ndr, r->in.bind_info);
12276 } else {
12277 r->in.bind_info = NULL;
12279 if (r->in.bind_info) {
12280 _mem_save_bind_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
12281 NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_info, 0);
12282 NDR_CHECK(ndr_pull_drsuapi_DsBindInfoCtr(ndr, NDR_SCALARS, r->in.bind_info));
12283 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_info_0, 0);
12285 NDR_PULL_ALLOC(ndr, r->out.bind_handle);
12286 ZERO_STRUCTP(r->out.bind_handle);
12288 if (flags & NDR_OUT) {
12289 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_bind_info));
12290 if (_ptr_bind_info) {
12291 NDR_PULL_ALLOC(ndr, r->out.bind_info);
12292 } else {
12293 r->out.bind_info = NULL;
12295 if (r->out.bind_info) {
12296 _mem_save_bind_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
12297 NDR_PULL_SET_MEM_CTX(ndr, r->out.bind_info, 0);
12298 NDR_CHECK(ndr_pull_drsuapi_DsBindInfoCtr(ndr, NDR_SCALARS, r->out.bind_info));
12299 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_info_0, 0);
12301 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12302 NDR_PULL_ALLOC(ndr, r->out.bind_handle);
12304 _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
12305 NDR_PULL_SET_MEM_CTX(ndr, r->out.bind_handle, LIBNDR_FLAG_REF_ALLOC);
12306 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.bind_handle));
12307 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC);
12308 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
12310 return NDR_ERR_SUCCESS;
12313 _PUBLIC_ void ndr_print_drsuapi_DsBind(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsBind *r)
12315 ndr_print_struct(ndr, name, "drsuapi_DsBind");
12316 ndr->depth++;
12317 if (flags & NDR_SET_VALUES) {
12318 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
12320 if (flags & NDR_IN) {
12321 ndr_print_struct(ndr, "in", "drsuapi_DsBind");
12322 ndr->depth++;
12323 ndr_print_ptr(ndr, "bind_guid", r->in.bind_guid);
12324 ndr->depth++;
12325 if (r->in.bind_guid) {
12326 ndr_print_GUID(ndr, "bind_guid", r->in.bind_guid);
12328 ndr->depth--;
12329 ndr_print_ptr(ndr, "bind_info", r->in.bind_info);
12330 ndr->depth++;
12331 if (r->in.bind_info) {
12332 ndr_print_drsuapi_DsBindInfoCtr(ndr, "bind_info", r->in.bind_info);
12334 ndr->depth--;
12335 ndr->depth--;
12337 if (flags & NDR_OUT) {
12338 ndr_print_struct(ndr, "out", "drsuapi_DsBind");
12339 ndr->depth++;
12340 ndr_print_ptr(ndr, "bind_info", r->out.bind_info);
12341 ndr->depth++;
12342 if (r->out.bind_info) {
12343 ndr_print_drsuapi_DsBindInfoCtr(ndr, "bind_info", r->out.bind_info);
12345 ndr->depth--;
12346 ndr_print_ptr(ndr, "bind_handle", r->out.bind_handle);
12347 ndr->depth++;
12348 ndr_print_policy_handle(ndr, "bind_handle", r->out.bind_handle);
12349 ndr->depth--;
12350 ndr_print_WERROR(ndr, "result", r->out.result);
12351 ndr->depth--;
12353 ndr->depth--;
12356 static enum ndr_err_code ndr_push_drsuapi_DsUnbind(struct ndr_push *ndr, int flags, const struct drsuapi_DsUnbind *r)
12358 if (flags & NDR_IN) {
12359 if (r->in.bind_handle == NULL) {
12360 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12362 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
12364 if (flags & NDR_OUT) {
12365 if (r->out.bind_handle == NULL) {
12366 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12368 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.bind_handle));
12369 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
12371 return NDR_ERR_SUCCESS;
12374 static enum ndr_err_code ndr_pull_drsuapi_DsUnbind(struct ndr_pull *ndr, int flags, struct drsuapi_DsUnbind *r)
12376 TALLOC_CTX *_mem_save_bind_handle_0;
12377 if (flags & NDR_IN) {
12378 ZERO_STRUCT(r->out);
12380 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12381 NDR_PULL_ALLOC(ndr, r->in.bind_handle);
12383 _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
12384 NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC);
12385 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
12386 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC);
12387 NDR_PULL_ALLOC(ndr, r->out.bind_handle);
12388 *r->out.bind_handle = *r->in.bind_handle;
12390 if (flags & NDR_OUT) {
12391 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12392 NDR_PULL_ALLOC(ndr, r->out.bind_handle);
12394 _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
12395 NDR_PULL_SET_MEM_CTX(ndr, r->out.bind_handle, LIBNDR_FLAG_REF_ALLOC);
12396 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.bind_handle));
12397 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC);
12398 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
12400 return NDR_ERR_SUCCESS;
12403 _PUBLIC_ void ndr_print_drsuapi_DsUnbind(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsUnbind *r)
12405 ndr_print_struct(ndr, name, "drsuapi_DsUnbind");
12406 ndr->depth++;
12407 if (flags & NDR_SET_VALUES) {
12408 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
12410 if (flags & NDR_IN) {
12411 ndr_print_struct(ndr, "in", "drsuapi_DsUnbind");
12412 ndr->depth++;
12413 ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle);
12414 ndr->depth++;
12415 ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle);
12416 ndr->depth--;
12417 ndr->depth--;
12419 if (flags & NDR_OUT) {
12420 ndr_print_struct(ndr, "out", "drsuapi_DsUnbind");
12421 ndr->depth++;
12422 ndr_print_ptr(ndr, "bind_handle", r->out.bind_handle);
12423 ndr->depth++;
12424 ndr_print_policy_handle(ndr, "bind_handle", r->out.bind_handle);
12425 ndr->depth--;
12426 ndr_print_WERROR(ndr, "result", r->out.result);
12427 ndr->depth--;
12429 ndr->depth--;
12432 static enum ndr_err_code ndr_push_drsuapi_DsReplicaSync(struct ndr_push *ndr, int flags, const struct drsuapi_DsReplicaSync *r)
12434 if (flags & NDR_IN) {
12435 if (r->in.bind_handle == NULL) {
12436 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12438 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
12439 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level));
12440 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->in.req, r->in.level));
12441 NDR_CHECK(ndr_push_drsuapi_DsReplicaSyncRequest(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.req));
12443 if (flags & NDR_OUT) {
12444 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
12446 return NDR_ERR_SUCCESS;
12449 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaSync(struct ndr_pull *ndr, int flags, struct drsuapi_DsReplicaSync *r)
12451 TALLOC_CTX *_mem_save_bind_handle_0;
12452 if (flags & NDR_IN) {
12453 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12454 NDR_PULL_ALLOC(ndr, r->in.bind_handle);
12456 _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
12457 NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC);
12458 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
12459 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC);
12460 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level));
12461 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->in.req, r->in.level));
12462 NDR_CHECK(ndr_pull_drsuapi_DsReplicaSyncRequest(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.req));
12464 if (flags & NDR_OUT) {
12465 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
12467 return NDR_ERR_SUCCESS;
12470 _PUBLIC_ void ndr_print_drsuapi_DsReplicaSync(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsReplicaSync *r)
12472 ndr_print_struct(ndr, name, "drsuapi_DsReplicaSync");
12473 ndr->depth++;
12474 if (flags & NDR_SET_VALUES) {
12475 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
12477 if (flags & NDR_IN) {
12478 ndr_print_struct(ndr, "in", "drsuapi_DsReplicaSync");
12479 ndr->depth++;
12480 ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle);
12481 ndr->depth++;
12482 ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle);
12483 ndr->depth--;
12484 ndr_print_int32(ndr, "level", r->in.level);
12485 ndr_print_set_switch_value(ndr, &r->in.req, r->in.level);
12486 ndr_print_drsuapi_DsReplicaSyncRequest(ndr, "req", &r->in.req);
12487 ndr->depth--;
12489 if (flags & NDR_OUT) {
12490 ndr_print_struct(ndr, "out", "drsuapi_DsReplicaSync");
12491 ndr->depth++;
12492 ndr_print_WERROR(ndr, "result", r->out.result);
12493 ndr->depth--;
12495 ndr->depth--;
12498 static enum ndr_err_code ndr_push_drsuapi_DsGetNCChanges(struct ndr_push *ndr, int flags, const struct drsuapi_DsGetNCChanges *r)
12500 if (flags & NDR_IN) {
12501 if (r->in.bind_handle == NULL) {
12502 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12504 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
12505 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level));
12506 if (r->in.req == NULL) {
12507 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12509 NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level));
12510 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req));
12512 if (flags & NDR_OUT) {
12513 if (r->out.level_out == NULL) {
12514 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12516 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, *r->out.level_out));
12517 if (r->out.ctr == NULL) {
12518 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12520 NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.ctr, *r->out.level_out));
12521 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr));
12522 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
12524 return NDR_ERR_SUCCESS;
12527 static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChanges(struct ndr_pull *ndr, int flags, struct drsuapi_DsGetNCChanges *r)
12529 TALLOC_CTX *_mem_save_bind_handle_0;
12530 TALLOC_CTX *_mem_save_req_0;
12531 TALLOC_CTX *_mem_save_level_out_0;
12532 TALLOC_CTX *_mem_save_ctr_0;
12533 if (flags & NDR_IN) {
12534 ZERO_STRUCT(r->out);
12536 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12537 NDR_PULL_ALLOC(ndr, r->in.bind_handle);
12539 _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
12540 NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC);
12541 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
12542 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC);
12543 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level));
12544 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12545 NDR_PULL_ALLOC(ndr, r->in.req);
12547 _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr);
12548 NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC);
12549 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level));
12550 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req));
12551 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC);
12552 NDR_PULL_ALLOC(ndr, r->out.level_out);
12553 ZERO_STRUCTP(r->out.level_out);
12554 NDR_PULL_ALLOC(ndr, r->out.ctr);
12555 ZERO_STRUCTP(r->out.ctr);
12557 if (flags & NDR_OUT) {
12558 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12559 NDR_PULL_ALLOC(ndr, r->out.level_out);
12561 _mem_save_level_out_0 = NDR_PULL_GET_MEM_CTX(ndr);
12562 NDR_PULL_SET_MEM_CTX(ndr, r->out.level_out, LIBNDR_FLAG_REF_ALLOC);
12563 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, r->out.level_out));
12564 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_out_0, LIBNDR_FLAG_REF_ALLOC);
12565 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12566 NDR_PULL_ALLOC(ndr, r->out.ctr);
12568 _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr);
12569 NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC);
12570 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.ctr, *r->out.level_out));
12571 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr));
12572 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC);
12573 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
12575 return NDR_ERR_SUCCESS;
12578 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChanges(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsGetNCChanges *r)
12580 ndr_print_struct(ndr, name, "drsuapi_DsGetNCChanges");
12581 ndr->depth++;
12582 if (flags & NDR_SET_VALUES) {
12583 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
12585 if (flags & NDR_IN) {
12586 ndr_print_struct(ndr, "in", "drsuapi_DsGetNCChanges");
12587 ndr->depth++;
12588 ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle);
12589 ndr->depth++;
12590 ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle);
12591 ndr->depth--;
12592 ndr_print_int32(ndr, "level", r->in.level);
12593 ndr_print_ptr(ndr, "req", r->in.req);
12594 ndr->depth++;
12595 ndr_print_set_switch_value(ndr, r->in.req, r->in.level);
12596 ndr_print_drsuapi_DsGetNCChangesRequest(ndr, "req", r->in.req);
12597 ndr->depth--;
12598 ndr->depth--;
12600 if (flags & NDR_OUT) {
12601 ndr_print_struct(ndr, "out", "drsuapi_DsGetNCChanges");
12602 ndr->depth++;
12603 ndr_print_ptr(ndr, "level_out", r->out.level_out);
12604 ndr->depth++;
12605 ndr_print_int32(ndr, "level_out", *r->out.level_out);
12606 ndr->depth--;
12607 ndr_print_ptr(ndr, "ctr", r->out.ctr);
12608 ndr->depth++;
12609 ndr_print_set_switch_value(ndr, r->out.ctr, *r->out.level_out);
12610 ndr_print_drsuapi_DsGetNCChangesCtr(ndr, "ctr", r->out.ctr);
12611 ndr->depth--;
12612 ndr_print_WERROR(ndr, "result", r->out.result);
12613 ndr->depth--;
12615 ndr->depth--;
12618 static enum ndr_err_code ndr_push_drsuapi_DsReplicaUpdateRefs(struct ndr_push *ndr, int flags, const struct drsuapi_DsReplicaUpdateRefs *r)
12620 if (flags & NDR_IN) {
12621 if (r->in.bind_handle == NULL) {
12622 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12624 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
12625 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level));
12626 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->in.req, r->in.level));
12627 NDR_CHECK(ndr_push_drsuapi_DsReplicaUpdateRefsRequest(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.req));
12629 if (flags & NDR_OUT) {
12630 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
12632 return NDR_ERR_SUCCESS;
12635 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaUpdateRefs(struct ndr_pull *ndr, int flags, struct drsuapi_DsReplicaUpdateRefs *r)
12637 TALLOC_CTX *_mem_save_bind_handle_0;
12638 if (flags & NDR_IN) {
12639 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12640 NDR_PULL_ALLOC(ndr, r->in.bind_handle);
12642 _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
12643 NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC);
12644 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
12645 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC);
12646 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level));
12647 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->in.req, r->in.level));
12648 NDR_CHECK(ndr_pull_drsuapi_DsReplicaUpdateRefsRequest(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.req));
12650 if (flags & NDR_OUT) {
12651 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
12653 return NDR_ERR_SUCCESS;
12656 _PUBLIC_ void ndr_print_drsuapi_DsReplicaUpdateRefs(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsReplicaUpdateRefs *r)
12658 ndr_print_struct(ndr, name, "drsuapi_DsReplicaUpdateRefs");
12659 ndr->depth++;
12660 if (flags & NDR_SET_VALUES) {
12661 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
12663 if (flags & NDR_IN) {
12664 ndr_print_struct(ndr, "in", "drsuapi_DsReplicaUpdateRefs");
12665 ndr->depth++;
12666 ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle);
12667 ndr->depth++;
12668 ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle);
12669 ndr->depth--;
12670 ndr_print_int32(ndr, "level", r->in.level);
12671 ndr_print_set_switch_value(ndr, &r->in.req, r->in.level);
12672 ndr_print_drsuapi_DsReplicaUpdateRefsRequest(ndr, "req", &r->in.req);
12673 ndr->depth--;
12675 if (flags & NDR_OUT) {
12676 ndr_print_struct(ndr, "out", "drsuapi_DsReplicaUpdateRefs");
12677 ndr->depth++;
12678 ndr_print_WERROR(ndr, "result", r->out.result);
12679 ndr->depth--;
12681 ndr->depth--;
12684 static enum ndr_err_code ndr_push_DRSUAPI_REPLICA_ADD(struct ndr_push *ndr, int flags, const struct DRSUAPI_REPLICA_ADD *r)
12686 if (flags & NDR_IN) {
12688 if (flags & NDR_OUT) {
12689 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
12691 return NDR_ERR_SUCCESS;
12694 static enum ndr_err_code ndr_pull_DRSUAPI_REPLICA_ADD(struct ndr_pull *ndr, int flags, struct DRSUAPI_REPLICA_ADD *r)
12696 if (flags & NDR_IN) {
12698 if (flags & NDR_OUT) {
12699 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
12701 return NDR_ERR_SUCCESS;
12704 _PUBLIC_ void ndr_print_DRSUAPI_REPLICA_ADD(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_REPLICA_ADD *r)
12706 ndr_print_struct(ndr, name, "DRSUAPI_REPLICA_ADD");
12707 ndr->depth++;
12708 if (flags & NDR_SET_VALUES) {
12709 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
12711 if (flags & NDR_IN) {
12712 ndr_print_struct(ndr, "in", "DRSUAPI_REPLICA_ADD");
12713 ndr->depth++;
12714 ndr->depth--;
12716 if (flags & NDR_OUT) {
12717 ndr_print_struct(ndr, "out", "DRSUAPI_REPLICA_ADD");
12718 ndr->depth++;
12719 ndr_print_WERROR(ndr, "result", r->out.result);
12720 ndr->depth--;
12722 ndr->depth--;
12725 static enum ndr_err_code ndr_push_DRSUAPI_REPLICA_DEL(struct ndr_push *ndr, int flags, const struct DRSUAPI_REPLICA_DEL *r)
12727 if (flags & NDR_IN) {
12729 if (flags & NDR_OUT) {
12730 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
12732 return NDR_ERR_SUCCESS;
12735 static enum ndr_err_code ndr_pull_DRSUAPI_REPLICA_DEL(struct ndr_pull *ndr, int flags, struct DRSUAPI_REPLICA_DEL *r)
12737 if (flags & NDR_IN) {
12739 if (flags & NDR_OUT) {
12740 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
12742 return NDR_ERR_SUCCESS;
12745 _PUBLIC_ void ndr_print_DRSUAPI_REPLICA_DEL(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_REPLICA_DEL *r)
12747 ndr_print_struct(ndr, name, "DRSUAPI_REPLICA_DEL");
12748 ndr->depth++;
12749 if (flags & NDR_SET_VALUES) {
12750 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
12752 if (flags & NDR_IN) {
12753 ndr_print_struct(ndr, "in", "DRSUAPI_REPLICA_DEL");
12754 ndr->depth++;
12755 ndr->depth--;
12757 if (flags & NDR_OUT) {
12758 ndr_print_struct(ndr, "out", "DRSUAPI_REPLICA_DEL");
12759 ndr->depth++;
12760 ndr_print_WERROR(ndr, "result", r->out.result);
12761 ndr->depth--;
12763 ndr->depth--;
12766 static enum ndr_err_code ndr_push_DRSUAPI_REPLICA_MODIFY(struct ndr_push *ndr, int flags, const struct DRSUAPI_REPLICA_MODIFY *r)
12768 if (flags & NDR_IN) {
12770 if (flags & NDR_OUT) {
12771 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
12773 return NDR_ERR_SUCCESS;
12776 static enum ndr_err_code ndr_pull_DRSUAPI_REPLICA_MODIFY(struct ndr_pull *ndr, int flags, struct DRSUAPI_REPLICA_MODIFY *r)
12778 if (flags & NDR_IN) {
12780 if (flags & NDR_OUT) {
12781 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
12783 return NDR_ERR_SUCCESS;
12786 _PUBLIC_ void ndr_print_DRSUAPI_REPLICA_MODIFY(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_REPLICA_MODIFY *r)
12788 ndr_print_struct(ndr, name, "DRSUAPI_REPLICA_MODIFY");
12789 ndr->depth++;
12790 if (flags & NDR_SET_VALUES) {
12791 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
12793 if (flags & NDR_IN) {
12794 ndr_print_struct(ndr, "in", "DRSUAPI_REPLICA_MODIFY");
12795 ndr->depth++;
12796 ndr->depth--;
12798 if (flags & NDR_OUT) {
12799 ndr_print_struct(ndr, "out", "DRSUAPI_REPLICA_MODIFY");
12800 ndr->depth++;
12801 ndr_print_WERROR(ndr, "result", r->out.result);
12802 ndr->depth--;
12804 ndr->depth--;
12807 static enum ndr_err_code ndr_push_DRSUAPI_VERIFY_NAMES(struct ndr_push *ndr, int flags, const struct DRSUAPI_VERIFY_NAMES *r)
12809 if (flags & NDR_IN) {
12811 if (flags & NDR_OUT) {
12812 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
12814 return NDR_ERR_SUCCESS;
12817 static enum ndr_err_code ndr_pull_DRSUAPI_VERIFY_NAMES(struct ndr_pull *ndr, int flags, struct DRSUAPI_VERIFY_NAMES *r)
12819 if (flags & NDR_IN) {
12821 if (flags & NDR_OUT) {
12822 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
12824 return NDR_ERR_SUCCESS;
12827 _PUBLIC_ void ndr_print_DRSUAPI_VERIFY_NAMES(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_VERIFY_NAMES *r)
12829 ndr_print_struct(ndr, name, "DRSUAPI_VERIFY_NAMES");
12830 ndr->depth++;
12831 if (flags & NDR_SET_VALUES) {
12832 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
12834 if (flags & NDR_IN) {
12835 ndr_print_struct(ndr, "in", "DRSUAPI_VERIFY_NAMES");
12836 ndr->depth++;
12837 ndr->depth--;
12839 if (flags & NDR_OUT) {
12840 ndr_print_struct(ndr, "out", "DRSUAPI_VERIFY_NAMES");
12841 ndr->depth++;
12842 ndr_print_WERROR(ndr, "result", r->out.result);
12843 ndr->depth--;
12845 ndr->depth--;
12848 static enum ndr_err_code ndr_push_drsuapi_DsGetMemberships(struct ndr_push *ndr, int flags, const struct drsuapi_DsGetMemberships *r)
12850 if (flags & NDR_IN) {
12851 if (r->in.bind_handle == NULL) {
12852 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12854 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
12855 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level));
12856 if (r->in.req == NULL) {
12857 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12859 NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level));
12860 NDR_CHECK(ndr_push_drsuapi_DsGetMembershipsRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req));
12862 if (flags & NDR_OUT) {
12863 if (r->out.level_out == NULL) {
12864 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12866 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, *r->out.level_out));
12867 if (r->out.ctr == NULL) {
12868 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
12870 NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.ctr, *r->out.level_out));
12871 NDR_CHECK(ndr_push_drsuapi_DsGetMembershipsCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr));
12872 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
12874 return NDR_ERR_SUCCESS;
12877 static enum ndr_err_code ndr_pull_drsuapi_DsGetMemberships(struct ndr_pull *ndr, int flags, struct drsuapi_DsGetMemberships *r)
12879 TALLOC_CTX *_mem_save_bind_handle_0;
12880 TALLOC_CTX *_mem_save_req_0;
12881 TALLOC_CTX *_mem_save_level_out_0;
12882 TALLOC_CTX *_mem_save_ctr_0;
12883 if (flags & NDR_IN) {
12884 ZERO_STRUCT(r->out);
12886 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12887 NDR_PULL_ALLOC(ndr, r->in.bind_handle);
12889 _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
12890 NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC);
12891 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
12892 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC);
12893 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level));
12894 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12895 NDR_PULL_ALLOC(ndr, r->in.req);
12897 _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr);
12898 NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC);
12899 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level));
12900 NDR_CHECK(ndr_pull_drsuapi_DsGetMembershipsRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req));
12901 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC);
12902 NDR_PULL_ALLOC(ndr, r->out.level_out);
12903 ZERO_STRUCTP(r->out.level_out);
12904 NDR_PULL_ALLOC(ndr, r->out.ctr);
12905 ZERO_STRUCTP(r->out.ctr);
12907 if (flags & NDR_OUT) {
12908 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12909 NDR_PULL_ALLOC(ndr, r->out.level_out);
12911 _mem_save_level_out_0 = NDR_PULL_GET_MEM_CTX(ndr);
12912 NDR_PULL_SET_MEM_CTX(ndr, r->out.level_out, LIBNDR_FLAG_REF_ALLOC);
12913 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, r->out.level_out));
12914 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_out_0, LIBNDR_FLAG_REF_ALLOC);
12915 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
12916 NDR_PULL_ALLOC(ndr, r->out.ctr);
12918 _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr);
12919 NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC);
12920 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.ctr, *r->out.level_out));
12921 NDR_CHECK(ndr_pull_drsuapi_DsGetMembershipsCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr));
12922 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC);
12923 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
12925 return NDR_ERR_SUCCESS;
12928 _PUBLIC_ void ndr_print_drsuapi_DsGetMemberships(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsGetMemberships *r)
12930 ndr_print_struct(ndr, name, "drsuapi_DsGetMemberships");
12931 ndr->depth++;
12932 if (flags & NDR_SET_VALUES) {
12933 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
12935 if (flags & NDR_IN) {
12936 ndr_print_struct(ndr, "in", "drsuapi_DsGetMemberships");
12937 ndr->depth++;
12938 ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle);
12939 ndr->depth++;
12940 ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle);
12941 ndr->depth--;
12942 ndr_print_int32(ndr, "level", r->in.level);
12943 ndr_print_ptr(ndr, "req", r->in.req);
12944 ndr->depth++;
12945 ndr_print_set_switch_value(ndr, r->in.req, r->in.level);
12946 ndr_print_drsuapi_DsGetMembershipsRequest(ndr, "req", r->in.req);
12947 ndr->depth--;
12948 ndr->depth--;
12950 if (flags & NDR_OUT) {
12951 ndr_print_struct(ndr, "out", "drsuapi_DsGetMemberships");
12952 ndr->depth++;
12953 ndr_print_ptr(ndr, "level_out", r->out.level_out);
12954 ndr->depth++;
12955 ndr_print_int32(ndr, "level_out", *r->out.level_out);
12956 ndr->depth--;
12957 ndr_print_ptr(ndr, "ctr", r->out.ctr);
12958 ndr->depth++;
12959 ndr_print_set_switch_value(ndr, r->out.ctr, *r->out.level_out);
12960 ndr_print_drsuapi_DsGetMembershipsCtr(ndr, "ctr", r->out.ctr);
12961 ndr->depth--;
12962 ndr_print_WERROR(ndr, "result", r->out.result);
12963 ndr->depth--;
12965 ndr->depth--;
12968 static enum ndr_err_code ndr_push_DRSUAPI_INTER_DOMAIN_MOVE(struct ndr_push *ndr, int flags, const struct DRSUAPI_INTER_DOMAIN_MOVE *r)
12970 if (flags & NDR_IN) {
12972 if (flags & NDR_OUT) {
12973 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
12975 return NDR_ERR_SUCCESS;
12978 static enum ndr_err_code ndr_pull_DRSUAPI_INTER_DOMAIN_MOVE(struct ndr_pull *ndr, int flags, struct DRSUAPI_INTER_DOMAIN_MOVE *r)
12980 if (flags & NDR_IN) {
12982 if (flags & NDR_OUT) {
12983 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
12985 return NDR_ERR_SUCCESS;
12988 _PUBLIC_ void ndr_print_DRSUAPI_INTER_DOMAIN_MOVE(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_INTER_DOMAIN_MOVE *r)
12990 ndr_print_struct(ndr, name, "DRSUAPI_INTER_DOMAIN_MOVE");
12991 ndr->depth++;
12992 if (flags & NDR_SET_VALUES) {
12993 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
12995 if (flags & NDR_IN) {
12996 ndr_print_struct(ndr, "in", "DRSUAPI_INTER_DOMAIN_MOVE");
12997 ndr->depth++;
12998 ndr->depth--;
13000 if (flags & NDR_OUT) {
13001 ndr_print_struct(ndr, "out", "DRSUAPI_INTER_DOMAIN_MOVE");
13002 ndr->depth++;
13003 ndr_print_WERROR(ndr, "result", r->out.result);
13004 ndr->depth--;
13006 ndr->depth--;
13009 static enum ndr_err_code ndr_push_drsuapi_DsGetNT4ChangeLog(struct ndr_push *ndr, int flags, const struct drsuapi_DsGetNT4ChangeLog *r)
13011 if (flags & NDR_IN) {
13012 if (r->in.bind_handle == NULL) {
13013 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13015 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
13016 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level));
13017 if (r->in.req == NULL) {
13018 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13020 NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level));
13021 NDR_CHECK(ndr_push_drsuapi_DsGetNT4ChangeLogRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req));
13023 if (flags & NDR_OUT) {
13024 if (r->out.level_out == NULL) {
13025 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13027 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.level_out));
13028 if (r->out.info == NULL) {
13029 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13031 NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.info, *r->out.level_out));
13032 NDR_CHECK(ndr_push_drsuapi_DsGetNT4ChangeLogInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info));
13033 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
13035 return NDR_ERR_SUCCESS;
13038 static enum ndr_err_code ndr_pull_drsuapi_DsGetNT4ChangeLog(struct ndr_pull *ndr, int flags, struct drsuapi_DsGetNT4ChangeLog *r)
13040 TALLOC_CTX *_mem_save_bind_handle_0;
13041 TALLOC_CTX *_mem_save_req_0;
13042 TALLOC_CTX *_mem_save_level_out_0;
13043 TALLOC_CTX *_mem_save_info_0;
13044 if (flags & NDR_IN) {
13045 ZERO_STRUCT(r->out);
13047 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13048 NDR_PULL_ALLOC(ndr, r->in.bind_handle);
13050 _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
13051 NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC);
13052 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
13053 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC);
13054 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level));
13055 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13056 NDR_PULL_ALLOC(ndr, r->in.req);
13058 _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr);
13059 NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC);
13060 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level));
13061 NDR_CHECK(ndr_pull_drsuapi_DsGetNT4ChangeLogRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req));
13062 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC);
13063 NDR_PULL_ALLOC(ndr, r->out.level_out);
13064 ZERO_STRUCTP(r->out.level_out);
13065 NDR_PULL_ALLOC(ndr, r->out.info);
13066 ZERO_STRUCTP(r->out.info);
13068 if (flags & NDR_OUT) {
13069 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13070 NDR_PULL_ALLOC(ndr, r->out.level_out);
13072 _mem_save_level_out_0 = NDR_PULL_GET_MEM_CTX(ndr);
13073 NDR_PULL_SET_MEM_CTX(ndr, r->out.level_out, LIBNDR_FLAG_REF_ALLOC);
13074 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.level_out));
13075 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_out_0, LIBNDR_FLAG_REF_ALLOC);
13076 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13077 NDR_PULL_ALLOC(ndr, r->out.info);
13079 _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
13080 NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC);
13081 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, *r->out.level_out));
13082 NDR_CHECK(ndr_pull_drsuapi_DsGetNT4ChangeLogInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info));
13083 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC);
13084 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
13086 return NDR_ERR_SUCCESS;
13089 _PUBLIC_ void ndr_print_drsuapi_DsGetNT4ChangeLog(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsGetNT4ChangeLog *r)
13091 ndr_print_struct(ndr, name, "drsuapi_DsGetNT4ChangeLog");
13092 ndr->depth++;
13093 if (flags & NDR_SET_VALUES) {
13094 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
13096 if (flags & NDR_IN) {
13097 ndr_print_struct(ndr, "in", "drsuapi_DsGetNT4ChangeLog");
13098 ndr->depth++;
13099 ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle);
13100 ndr->depth++;
13101 ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle);
13102 ndr->depth--;
13103 ndr_print_uint32(ndr, "level", r->in.level);
13104 ndr_print_ptr(ndr, "req", r->in.req);
13105 ndr->depth++;
13106 ndr_print_set_switch_value(ndr, r->in.req, r->in.level);
13107 ndr_print_drsuapi_DsGetNT4ChangeLogRequest(ndr, "req", r->in.req);
13108 ndr->depth--;
13109 ndr->depth--;
13111 if (flags & NDR_OUT) {
13112 ndr_print_struct(ndr, "out", "drsuapi_DsGetNT4ChangeLog");
13113 ndr->depth++;
13114 ndr_print_ptr(ndr, "level_out", r->out.level_out);
13115 ndr->depth++;
13116 ndr_print_uint32(ndr, "level_out", *r->out.level_out);
13117 ndr->depth--;
13118 ndr_print_ptr(ndr, "info", r->out.info);
13119 ndr->depth++;
13120 ndr_print_set_switch_value(ndr, r->out.info, *r->out.level_out);
13121 ndr_print_drsuapi_DsGetNT4ChangeLogInfo(ndr, "info", r->out.info);
13122 ndr->depth--;
13123 ndr_print_WERROR(ndr, "result", r->out.result);
13124 ndr->depth--;
13126 ndr->depth--;
13129 static enum ndr_err_code ndr_push_drsuapi_DsCrackNames(struct ndr_push *ndr, int flags, const struct drsuapi_DsCrackNames *r)
13131 if (flags & NDR_IN) {
13132 if (r->in.bind_handle == NULL) {
13133 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13135 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
13136 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level));
13137 if (r->in.req == NULL) {
13138 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13140 NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level));
13141 NDR_CHECK(ndr_push_drsuapi_DsNameRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req));
13143 if (flags & NDR_OUT) {
13144 if (r->out.level_out == NULL) {
13145 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13147 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, *r->out.level_out));
13148 if (r->out.ctr == NULL) {
13149 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13151 NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.ctr, *r->out.level_out));
13152 NDR_CHECK(ndr_push_drsuapi_DsNameCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr));
13153 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
13155 return NDR_ERR_SUCCESS;
13158 static enum ndr_err_code ndr_pull_drsuapi_DsCrackNames(struct ndr_pull *ndr, int flags, struct drsuapi_DsCrackNames *r)
13160 TALLOC_CTX *_mem_save_bind_handle_0;
13161 TALLOC_CTX *_mem_save_req_0;
13162 TALLOC_CTX *_mem_save_level_out_0;
13163 TALLOC_CTX *_mem_save_ctr_0;
13164 if (flags & NDR_IN) {
13165 ZERO_STRUCT(r->out);
13167 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13168 NDR_PULL_ALLOC(ndr, r->in.bind_handle);
13170 _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
13171 NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC);
13172 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
13173 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC);
13174 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level));
13175 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13176 NDR_PULL_ALLOC(ndr, r->in.req);
13178 _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr);
13179 NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC);
13180 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level));
13181 NDR_CHECK(ndr_pull_drsuapi_DsNameRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req));
13182 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC);
13183 NDR_PULL_ALLOC(ndr, r->out.level_out);
13184 ZERO_STRUCTP(r->out.level_out);
13185 NDR_PULL_ALLOC(ndr, r->out.ctr);
13186 ZERO_STRUCTP(r->out.ctr);
13188 if (flags & NDR_OUT) {
13189 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13190 NDR_PULL_ALLOC(ndr, r->out.level_out);
13192 _mem_save_level_out_0 = NDR_PULL_GET_MEM_CTX(ndr);
13193 NDR_PULL_SET_MEM_CTX(ndr, r->out.level_out, LIBNDR_FLAG_REF_ALLOC);
13194 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, r->out.level_out));
13195 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_out_0, LIBNDR_FLAG_REF_ALLOC);
13196 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13197 NDR_PULL_ALLOC(ndr, r->out.ctr);
13199 _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr);
13200 NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC);
13201 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.ctr, *r->out.level_out));
13202 NDR_CHECK(ndr_pull_drsuapi_DsNameCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr));
13203 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC);
13204 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
13206 return NDR_ERR_SUCCESS;
13209 _PUBLIC_ void ndr_print_drsuapi_DsCrackNames(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsCrackNames *r)
13211 ndr_print_struct(ndr, name, "drsuapi_DsCrackNames");
13212 ndr->depth++;
13213 if (flags & NDR_SET_VALUES) {
13214 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
13216 if (flags & NDR_IN) {
13217 ndr_print_struct(ndr, "in", "drsuapi_DsCrackNames");
13218 ndr->depth++;
13219 ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle);
13220 ndr->depth++;
13221 ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle);
13222 ndr->depth--;
13223 ndr_print_int32(ndr, "level", r->in.level);
13224 ndr_print_ptr(ndr, "req", r->in.req);
13225 ndr->depth++;
13226 ndr_print_set_switch_value(ndr, r->in.req, r->in.level);
13227 ndr_print_drsuapi_DsNameRequest(ndr, "req", r->in.req);
13228 ndr->depth--;
13229 ndr->depth--;
13231 if (flags & NDR_OUT) {
13232 ndr_print_struct(ndr, "out", "drsuapi_DsCrackNames");
13233 ndr->depth++;
13234 ndr_print_ptr(ndr, "level_out", r->out.level_out);
13235 ndr->depth++;
13236 ndr_print_int32(ndr, "level_out", *r->out.level_out);
13237 ndr->depth--;
13238 ndr_print_ptr(ndr, "ctr", r->out.ctr);
13239 ndr->depth++;
13240 ndr_print_set_switch_value(ndr, r->out.ctr, *r->out.level_out);
13241 ndr_print_drsuapi_DsNameCtr(ndr, "ctr", r->out.ctr);
13242 ndr->depth--;
13243 ndr_print_WERROR(ndr, "result", r->out.result);
13244 ndr->depth--;
13246 ndr->depth--;
13249 static enum ndr_err_code ndr_push_drsuapi_DsWriteAccountSpn(struct ndr_push *ndr, int flags, const struct drsuapi_DsWriteAccountSpn *r)
13251 if (flags & NDR_IN) {
13252 if (r->in.bind_handle == NULL) {
13253 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13255 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
13256 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level));
13257 if (r->in.req == NULL) {
13258 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13260 NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level));
13261 NDR_CHECK(ndr_push_drsuapi_DsWriteAccountSpnRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req));
13263 if (flags & NDR_OUT) {
13264 if (r->out.level_out == NULL) {
13265 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13267 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, *r->out.level_out));
13268 if (r->out.res == NULL) {
13269 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13271 NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.res, *r->out.level_out));
13272 NDR_CHECK(ndr_push_drsuapi_DsWriteAccountSpnResult(ndr, NDR_SCALARS, r->out.res));
13273 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
13275 return NDR_ERR_SUCCESS;
13278 static enum ndr_err_code ndr_pull_drsuapi_DsWriteAccountSpn(struct ndr_pull *ndr, int flags, struct drsuapi_DsWriteAccountSpn *r)
13280 TALLOC_CTX *_mem_save_bind_handle_0;
13281 TALLOC_CTX *_mem_save_req_0;
13282 TALLOC_CTX *_mem_save_level_out_0;
13283 TALLOC_CTX *_mem_save_res_0;
13284 if (flags & NDR_IN) {
13285 ZERO_STRUCT(r->out);
13287 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13288 NDR_PULL_ALLOC(ndr, r->in.bind_handle);
13290 _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
13291 NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC);
13292 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
13293 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC);
13294 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level));
13295 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13296 NDR_PULL_ALLOC(ndr, r->in.req);
13298 _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr);
13299 NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC);
13300 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level));
13301 NDR_CHECK(ndr_pull_drsuapi_DsWriteAccountSpnRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req));
13302 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC);
13303 NDR_PULL_ALLOC(ndr, r->out.level_out);
13304 ZERO_STRUCTP(r->out.level_out);
13305 NDR_PULL_ALLOC(ndr, r->out.res);
13306 ZERO_STRUCTP(r->out.res);
13308 if (flags & NDR_OUT) {
13309 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13310 NDR_PULL_ALLOC(ndr, r->out.level_out);
13312 _mem_save_level_out_0 = NDR_PULL_GET_MEM_CTX(ndr);
13313 NDR_PULL_SET_MEM_CTX(ndr, r->out.level_out, LIBNDR_FLAG_REF_ALLOC);
13314 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, r->out.level_out));
13315 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_out_0, LIBNDR_FLAG_REF_ALLOC);
13316 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13317 NDR_PULL_ALLOC(ndr, r->out.res);
13319 _mem_save_res_0 = NDR_PULL_GET_MEM_CTX(ndr);
13320 NDR_PULL_SET_MEM_CTX(ndr, r->out.res, LIBNDR_FLAG_REF_ALLOC);
13321 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.res, *r->out.level_out));
13322 NDR_CHECK(ndr_pull_drsuapi_DsWriteAccountSpnResult(ndr, NDR_SCALARS, r->out.res));
13323 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_res_0, LIBNDR_FLAG_REF_ALLOC);
13324 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
13326 return NDR_ERR_SUCCESS;
13329 _PUBLIC_ void ndr_print_drsuapi_DsWriteAccountSpn(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsWriteAccountSpn *r)
13331 ndr_print_struct(ndr, name, "drsuapi_DsWriteAccountSpn");
13332 ndr->depth++;
13333 if (flags & NDR_SET_VALUES) {
13334 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
13336 if (flags & NDR_IN) {
13337 ndr_print_struct(ndr, "in", "drsuapi_DsWriteAccountSpn");
13338 ndr->depth++;
13339 ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle);
13340 ndr->depth++;
13341 ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle);
13342 ndr->depth--;
13343 ndr_print_int32(ndr, "level", r->in.level);
13344 ndr_print_ptr(ndr, "req", r->in.req);
13345 ndr->depth++;
13346 ndr_print_set_switch_value(ndr, r->in.req, r->in.level);
13347 ndr_print_drsuapi_DsWriteAccountSpnRequest(ndr, "req", r->in.req);
13348 ndr->depth--;
13349 ndr->depth--;
13351 if (flags & NDR_OUT) {
13352 ndr_print_struct(ndr, "out", "drsuapi_DsWriteAccountSpn");
13353 ndr->depth++;
13354 ndr_print_ptr(ndr, "level_out", r->out.level_out);
13355 ndr->depth++;
13356 ndr_print_int32(ndr, "level_out", *r->out.level_out);
13357 ndr->depth--;
13358 ndr_print_ptr(ndr, "res", r->out.res);
13359 ndr->depth++;
13360 ndr_print_set_switch_value(ndr, r->out.res, *r->out.level_out);
13361 ndr_print_drsuapi_DsWriteAccountSpnResult(ndr, "res", r->out.res);
13362 ndr->depth--;
13363 ndr_print_WERROR(ndr, "result", r->out.result);
13364 ndr->depth--;
13366 ndr->depth--;
13369 static enum ndr_err_code ndr_push_drsuapi_DsRemoveDSServer(struct ndr_push *ndr, int flags, const struct drsuapi_DsRemoveDSServer *r)
13371 if (flags & NDR_IN) {
13372 if (r->in.bind_handle == NULL) {
13373 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13375 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
13376 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level));
13377 if (r->in.req == NULL) {
13378 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13380 NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level));
13381 NDR_CHECK(ndr_push_drsuapi_DsRemoveDSServerRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req));
13383 if (flags & NDR_OUT) {
13384 if (r->out.level_out == NULL) {
13385 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13387 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, *r->out.level_out));
13388 if (r->out.res == NULL) {
13389 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13391 NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.res, *r->out.level_out));
13392 NDR_CHECK(ndr_push_drsuapi_DsRemoveDSServerResult(ndr, NDR_SCALARS, r->out.res));
13393 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
13395 return NDR_ERR_SUCCESS;
13398 static enum ndr_err_code ndr_pull_drsuapi_DsRemoveDSServer(struct ndr_pull *ndr, int flags, struct drsuapi_DsRemoveDSServer *r)
13400 TALLOC_CTX *_mem_save_bind_handle_0;
13401 TALLOC_CTX *_mem_save_req_0;
13402 TALLOC_CTX *_mem_save_level_out_0;
13403 TALLOC_CTX *_mem_save_res_0;
13404 if (flags & NDR_IN) {
13405 ZERO_STRUCT(r->out);
13407 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13408 NDR_PULL_ALLOC(ndr, r->in.bind_handle);
13410 _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
13411 NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC);
13412 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
13413 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC);
13414 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level));
13415 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13416 NDR_PULL_ALLOC(ndr, r->in.req);
13418 _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr);
13419 NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC);
13420 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level));
13421 NDR_CHECK(ndr_pull_drsuapi_DsRemoveDSServerRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req));
13422 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC);
13423 NDR_PULL_ALLOC(ndr, r->out.level_out);
13424 ZERO_STRUCTP(r->out.level_out);
13425 NDR_PULL_ALLOC(ndr, r->out.res);
13426 ZERO_STRUCTP(r->out.res);
13428 if (flags & NDR_OUT) {
13429 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13430 NDR_PULL_ALLOC(ndr, r->out.level_out);
13432 _mem_save_level_out_0 = NDR_PULL_GET_MEM_CTX(ndr);
13433 NDR_PULL_SET_MEM_CTX(ndr, r->out.level_out, LIBNDR_FLAG_REF_ALLOC);
13434 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, r->out.level_out));
13435 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_out_0, LIBNDR_FLAG_REF_ALLOC);
13436 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13437 NDR_PULL_ALLOC(ndr, r->out.res);
13439 _mem_save_res_0 = NDR_PULL_GET_MEM_CTX(ndr);
13440 NDR_PULL_SET_MEM_CTX(ndr, r->out.res, LIBNDR_FLAG_REF_ALLOC);
13441 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.res, *r->out.level_out));
13442 NDR_CHECK(ndr_pull_drsuapi_DsRemoveDSServerResult(ndr, NDR_SCALARS, r->out.res));
13443 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_res_0, LIBNDR_FLAG_REF_ALLOC);
13444 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
13446 return NDR_ERR_SUCCESS;
13449 _PUBLIC_ void ndr_print_drsuapi_DsRemoveDSServer(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsRemoveDSServer *r)
13451 ndr_print_struct(ndr, name, "drsuapi_DsRemoveDSServer");
13452 ndr->depth++;
13453 if (flags & NDR_SET_VALUES) {
13454 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
13456 if (flags & NDR_IN) {
13457 ndr_print_struct(ndr, "in", "drsuapi_DsRemoveDSServer");
13458 ndr->depth++;
13459 ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle);
13460 ndr->depth++;
13461 ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle);
13462 ndr->depth--;
13463 ndr_print_int32(ndr, "level", r->in.level);
13464 ndr_print_ptr(ndr, "req", r->in.req);
13465 ndr->depth++;
13466 ndr_print_set_switch_value(ndr, r->in.req, r->in.level);
13467 ndr_print_drsuapi_DsRemoveDSServerRequest(ndr, "req", r->in.req);
13468 ndr->depth--;
13469 ndr->depth--;
13471 if (flags & NDR_OUT) {
13472 ndr_print_struct(ndr, "out", "drsuapi_DsRemoveDSServer");
13473 ndr->depth++;
13474 ndr_print_ptr(ndr, "level_out", r->out.level_out);
13475 ndr->depth++;
13476 ndr_print_int32(ndr, "level_out", *r->out.level_out);
13477 ndr->depth--;
13478 ndr_print_ptr(ndr, "res", r->out.res);
13479 ndr->depth++;
13480 ndr_print_set_switch_value(ndr, r->out.res, *r->out.level_out);
13481 ndr_print_drsuapi_DsRemoveDSServerResult(ndr, "res", r->out.res);
13482 ndr->depth--;
13483 ndr_print_WERROR(ndr, "result", r->out.result);
13484 ndr->depth--;
13486 ndr->depth--;
13489 static enum ndr_err_code ndr_push_DRSUAPI_REMOVE_DS_DOMAIN(struct ndr_push *ndr, int flags, const struct DRSUAPI_REMOVE_DS_DOMAIN *r)
13491 if (flags & NDR_IN) {
13493 if (flags & NDR_OUT) {
13494 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
13496 return NDR_ERR_SUCCESS;
13499 static enum ndr_err_code ndr_pull_DRSUAPI_REMOVE_DS_DOMAIN(struct ndr_pull *ndr, int flags, struct DRSUAPI_REMOVE_DS_DOMAIN *r)
13501 if (flags & NDR_IN) {
13503 if (flags & NDR_OUT) {
13504 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
13506 return NDR_ERR_SUCCESS;
13509 _PUBLIC_ void ndr_print_DRSUAPI_REMOVE_DS_DOMAIN(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_REMOVE_DS_DOMAIN *r)
13511 ndr_print_struct(ndr, name, "DRSUAPI_REMOVE_DS_DOMAIN");
13512 ndr->depth++;
13513 if (flags & NDR_SET_VALUES) {
13514 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
13516 if (flags & NDR_IN) {
13517 ndr_print_struct(ndr, "in", "DRSUAPI_REMOVE_DS_DOMAIN");
13518 ndr->depth++;
13519 ndr->depth--;
13521 if (flags & NDR_OUT) {
13522 ndr_print_struct(ndr, "out", "DRSUAPI_REMOVE_DS_DOMAIN");
13523 ndr->depth++;
13524 ndr_print_WERROR(ndr, "result", r->out.result);
13525 ndr->depth--;
13527 ndr->depth--;
13530 static enum ndr_err_code ndr_push_drsuapi_DsGetDomainControllerInfo(struct ndr_push *ndr, int flags, const struct drsuapi_DsGetDomainControllerInfo *r)
13532 if (flags & NDR_IN) {
13533 if (r->in.bind_handle == NULL) {
13534 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13536 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
13537 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level));
13538 if (r->in.req == NULL) {
13539 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13541 NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level));
13542 NDR_CHECK(ndr_push_drsuapi_DsGetDCInfoRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req));
13544 if (flags & NDR_OUT) {
13545 if (r->out.level_out == NULL) {
13546 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13548 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, *r->out.level_out));
13549 if (r->out.ctr == NULL) {
13550 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13552 NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.ctr, *r->out.level_out));
13553 NDR_CHECK(ndr_push_drsuapi_DsGetDCInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr));
13554 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
13556 return NDR_ERR_SUCCESS;
13559 static enum ndr_err_code ndr_pull_drsuapi_DsGetDomainControllerInfo(struct ndr_pull *ndr, int flags, struct drsuapi_DsGetDomainControllerInfo *r)
13561 TALLOC_CTX *_mem_save_bind_handle_0;
13562 TALLOC_CTX *_mem_save_req_0;
13563 TALLOC_CTX *_mem_save_level_out_0;
13564 TALLOC_CTX *_mem_save_ctr_0;
13565 if (flags & NDR_IN) {
13566 ZERO_STRUCT(r->out);
13568 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13569 NDR_PULL_ALLOC(ndr, r->in.bind_handle);
13571 _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
13572 NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC);
13573 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
13574 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC);
13575 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level));
13576 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13577 NDR_PULL_ALLOC(ndr, r->in.req);
13579 _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr);
13580 NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC);
13581 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level));
13582 NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfoRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req));
13583 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC);
13584 NDR_PULL_ALLOC(ndr, r->out.level_out);
13585 ZERO_STRUCTP(r->out.level_out);
13586 NDR_PULL_ALLOC(ndr, r->out.ctr);
13587 ZERO_STRUCTP(r->out.ctr);
13589 if (flags & NDR_OUT) {
13590 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13591 NDR_PULL_ALLOC(ndr, r->out.level_out);
13593 _mem_save_level_out_0 = NDR_PULL_GET_MEM_CTX(ndr);
13594 NDR_PULL_SET_MEM_CTX(ndr, r->out.level_out, LIBNDR_FLAG_REF_ALLOC);
13595 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, r->out.level_out));
13596 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_out_0, LIBNDR_FLAG_REF_ALLOC);
13597 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13598 NDR_PULL_ALLOC(ndr, r->out.ctr);
13600 _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr);
13601 NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC);
13602 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.ctr, *r->out.level_out));
13603 NDR_CHECK(ndr_pull_drsuapi_DsGetDCInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr));
13604 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC);
13605 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
13607 return NDR_ERR_SUCCESS;
13610 _PUBLIC_ void ndr_print_drsuapi_DsGetDomainControllerInfo(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsGetDomainControllerInfo *r)
13612 ndr_print_struct(ndr, name, "drsuapi_DsGetDomainControllerInfo");
13613 ndr->depth++;
13614 if (flags & NDR_SET_VALUES) {
13615 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
13617 if (flags & NDR_IN) {
13618 ndr_print_struct(ndr, "in", "drsuapi_DsGetDomainControllerInfo");
13619 ndr->depth++;
13620 ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle);
13621 ndr->depth++;
13622 ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle);
13623 ndr->depth--;
13624 ndr_print_int32(ndr, "level", r->in.level);
13625 ndr_print_ptr(ndr, "req", r->in.req);
13626 ndr->depth++;
13627 ndr_print_set_switch_value(ndr, r->in.req, r->in.level);
13628 ndr_print_drsuapi_DsGetDCInfoRequest(ndr, "req", r->in.req);
13629 ndr->depth--;
13630 ndr->depth--;
13632 if (flags & NDR_OUT) {
13633 ndr_print_struct(ndr, "out", "drsuapi_DsGetDomainControllerInfo");
13634 ndr->depth++;
13635 ndr_print_ptr(ndr, "level_out", r->out.level_out);
13636 ndr->depth++;
13637 ndr_print_int32(ndr, "level_out", *r->out.level_out);
13638 ndr->depth--;
13639 ndr_print_ptr(ndr, "ctr", r->out.ctr);
13640 ndr->depth++;
13641 ndr_print_set_switch_value(ndr, r->out.ctr, *r->out.level_out);
13642 ndr_print_drsuapi_DsGetDCInfoCtr(ndr, "ctr", r->out.ctr);
13643 ndr->depth--;
13644 ndr_print_WERROR(ndr, "result", r->out.result);
13645 ndr->depth--;
13647 ndr->depth--;
13650 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsAddEntry(struct ndr_push *ndr, int flags, const struct drsuapi_DsAddEntry *r)
13652 if (flags & NDR_IN) {
13653 if (r->in.bind_handle == NULL) {
13654 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13656 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
13657 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level));
13658 if (r->in.req == NULL) {
13659 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13661 NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level));
13662 NDR_CHECK(ndr_push_drsuapi_DsAddEntryRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req));
13664 if (flags & NDR_OUT) {
13665 if (r->out.level_out == NULL) {
13666 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13668 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, *r->out.level_out));
13669 if (r->out.ctr == NULL) {
13670 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13672 NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.ctr, *r->out.level_out));
13673 NDR_CHECK(ndr_push_drsuapi_DsAddEntryCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr));
13674 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
13676 return NDR_ERR_SUCCESS;
13679 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsAddEntry(struct ndr_pull *ndr, int flags, struct drsuapi_DsAddEntry *r)
13681 TALLOC_CTX *_mem_save_bind_handle_0;
13682 TALLOC_CTX *_mem_save_req_0;
13683 TALLOC_CTX *_mem_save_level_out_0;
13684 TALLOC_CTX *_mem_save_ctr_0;
13685 if (flags & NDR_IN) {
13686 ZERO_STRUCT(r->out);
13688 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13689 NDR_PULL_ALLOC(ndr, r->in.bind_handle);
13691 _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
13692 NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC);
13693 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
13694 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC);
13695 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level));
13696 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13697 NDR_PULL_ALLOC(ndr, r->in.req);
13699 _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr);
13700 NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC);
13701 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level));
13702 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req));
13703 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC);
13704 NDR_PULL_ALLOC(ndr, r->out.level_out);
13705 ZERO_STRUCTP(r->out.level_out);
13706 NDR_PULL_ALLOC(ndr, r->out.ctr);
13707 ZERO_STRUCTP(r->out.ctr);
13709 if (flags & NDR_OUT) {
13710 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13711 NDR_PULL_ALLOC(ndr, r->out.level_out);
13713 _mem_save_level_out_0 = NDR_PULL_GET_MEM_CTX(ndr);
13714 NDR_PULL_SET_MEM_CTX(ndr, r->out.level_out, LIBNDR_FLAG_REF_ALLOC);
13715 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, r->out.level_out));
13716 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_out_0, LIBNDR_FLAG_REF_ALLOC);
13717 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13718 NDR_PULL_ALLOC(ndr, r->out.ctr);
13720 _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr);
13721 NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC);
13722 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.ctr, *r->out.level_out));
13723 NDR_CHECK(ndr_pull_drsuapi_DsAddEntryCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr));
13724 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC);
13725 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
13727 return NDR_ERR_SUCCESS;
13730 _PUBLIC_ void ndr_print_drsuapi_DsAddEntry(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsAddEntry *r)
13732 ndr_print_struct(ndr, name, "drsuapi_DsAddEntry");
13733 ndr->depth++;
13734 if (flags & NDR_SET_VALUES) {
13735 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
13737 if (flags & NDR_IN) {
13738 ndr_print_struct(ndr, "in", "drsuapi_DsAddEntry");
13739 ndr->depth++;
13740 ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle);
13741 ndr->depth++;
13742 ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle);
13743 ndr->depth--;
13744 ndr_print_int32(ndr, "level", r->in.level);
13745 ndr_print_ptr(ndr, "req", r->in.req);
13746 ndr->depth++;
13747 ndr_print_set_switch_value(ndr, r->in.req, r->in.level);
13748 ndr_print_drsuapi_DsAddEntryRequest(ndr, "req", r->in.req);
13749 ndr->depth--;
13750 ndr->depth--;
13752 if (flags & NDR_OUT) {
13753 ndr_print_struct(ndr, "out", "drsuapi_DsAddEntry");
13754 ndr->depth++;
13755 ndr_print_ptr(ndr, "level_out", r->out.level_out);
13756 ndr->depth++;
13757 ndr_print_int32(ndr, "level_out", *r->out.level_out);
13758 ndr->depth--;
13759 ndr_print_ptr(ndr, "ctr", r->out.ctr);
13760 ndr->depth++;
13761 ndr_print_set_switch_value(ndr, r->out.ctr, *r->out.level_out);
13762 ndr_print_drsuapi_DsAddEntryCtr(ndr, "ctr", r->out.ctr);
13763 ndr->depth--;
13764 ndr_print_WERROR(ndr, "result", r->out.result);
13765 ndr->depth--;
13767 ndr->depth--;
13770 static enum ndr_err_code ndr_push_DRSUAPI_EXECUTE_KCC(struct ndr_push *ndr, int flags, const struct DRSUAPI_EXECUTE_KCC *r)
13772 if (flags & NDR_IN) {
13774 if (flags & NDR_OUT) {
13775 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
13777 return NDR_ERR_SUCCESS;
13780 static enum ndr_err_code ndr_pull_DRSUAPI_EXECUTE_KCC(struct ndr_pull *ndr, int flags, struct DRSUAPI_EXECUTE_KCC *r)
13782 if (flags & NDR_IN) {
13784 if (flags & NDR_OUT) {
13785 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
13787 return NDR_ERR_SUCCESS;
13790 _PUBLIC_ void ndr_print_DRSUAPI_EXECUTE_KCC(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_EXECUTE_KCC *r)
13792 ndr_print_struct(ndr, name, "DRSUAPI_EXECUTE_KCC");
13793 ndr->depth++;
13794 if (flags & NDR_SET_VALUES) {
13795 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
13797 if (flags & NDR_IN) {
13798 ndr_print_struct(ndr, "in", "DRSUAPI_EXECUTE_KCC");
13799 ndr->depth++;
13800 ndr->depth--;
13802 if (flags & NDR_OUT) {
13803 ndr_print_struct(ndr, "out", "DRSUAPI_EXECUTE_KCC");
13804 ndr->depth++;
13805 ndr_print_WERROR(ndr, "result", r->out.result);
13806 ndr->depth--;
13808 ndr->depth--;
13811 static enum ndr_err_code ndr_push_drsuapi_DsReplicaGetInfo(struct ndr_push *ndr, int flags, const struct drsuapi_DsReplicaGetInfo *r)
13813 if (flags & NDR_IN) {
13814 if (r->in.bind_handle == NULL) {
13815 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13817 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
13818 NDR_CHECK(ndr_push_drsuapi_DsReplicaGetInfoLevel(ndr, NDR_SCALARS, r->in.level));
13819 if (r->in.req == NULL) {
13820 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13822 NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level));
13823 NDR_CHECK(ndr_push_drsuapi_DsReplicaGetInfoRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req));
13825 if (flags & NDR_OUT) {
13826 if (r->out.info_type == NULL) {
13827 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13829 NDR_CHECK(ndr_push_drsuapi_DsReplicaInfoType(ndr, NDR_SCALARS, *r->out.info_type));
13830 if (r->out.info == NULL) {
13831 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13833 NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.info, *r->out.info_type));
13834 NDR_CHECK(ndr_push_drsuapi_DsReplicaInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info));
13835 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
13837 return NDR_ERR_SUCCESS;
13840 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaGetInfo(struct ndr_pull *ndr, int flags, struct drsuapi_DsReplicaGetInfo *r)
13842 TALLOC_CTX *_mem_save_bind_handle_0;
13843 TALLOC_CTX *_mem_save_req_0;
13844 TALLOC_CTX *_mem_save_info_type_0;
13845 TALLOC_CTX *_mem_save_info_0;
13846 if (flags & NDR_IN) {
13847 ZERO_STRUCT(r->out);
13849 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13850 NDR_PULL_ALLOC(ndr, r->in.bind_handle);
13852 _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
13853 NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC);
13854 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
13855 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC);
13856 NDR_CHECK(ndr_pull_drsuapi_DsReplicaGetInfoLevel(ndr, NDR_SCALARS, &r->in.level));
13857 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13858 NDR_PULL_ALLOC(ndr, r->in.req);
13860 _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr);
13861 NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC);
13862 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level));
13863 NDR_CHECK(ndr_pull_drsuapi_DsReplicaGetInfoRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req));
13864 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC);
13865 NDR_PULL_ALLOC(ndr, r->out.info_type);
13866 ZERO_STRUCTP(r->out.info_type);
13867 NDR_PULL_ALLOC(ndr, r->out.info);
13868 ZERO_STRUCTP(r->out.info);
13870 if (flags & NDR_OUT) {
13871 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13872 NDR_PULL_ALLOC(ndr, r->out.info_type);
13874 _mem_save_info_type_0 = NDR_PULL_GET_MEM_CTX(ndr);
13875 NDR_PULL_SET_MEM_CTX(ndr, r->out.info_type, LIBNDR_FLAG_REF_ALLOC);
13876 NDR_CHECK(ndr_pull_drsuapi_DsReplicaInfoType(ndr, NDR_SCALARS, r->out.info_type));
13877 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_type_0, LIBNDR_FLAG_REF_ALLOC);
13878 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
13879 NDR_PULL_ALLOC(ndr, r->out.info);
13881 _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
13882 NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC);
13883 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, *r->out.info_type));
13884 NDR_CHECK(ndr_pull_drsuapi_DsReplicaInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info));
13885 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC);
13886 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
13888 return NDR_ERR_SUCCESS;
13891 _PUBLIC_ void ndr_print_drsuapi_DsReplicaGetInfo(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsReplicaGetInfo *r)
13893 ndr_print_struct(ndr, name, "drsuapi_DsReplicaGetInfo");
13894 ndr->depth++;
13895 if (flags & NDR_SET_VALUES) {
13896 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
13898 if (flags & NDR_IN) {
13899 ndr_print_struct(ndr, "in", "drsuapi_DsReplicaGetInfo");
13900 ndr->depth++;
13901 ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle);
13902 ndr->depth++;
13903 ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle);
13904 ndr->depth--;
13905 ndr_print_drsuapi_DsReplicaGetInfoLevel(ndr, "level", r->in.level);
13906 ndr_print_ptr(ndr, "req", r->in.req);
13907 ndr->depth++;
13908 ndr_print_set_switch_value(ndr, r->in.req, r->in.level);
13909 ndr_print_drsuapi_DsReplicaGetInfoRequest(ndr, "req", r->in.req);
13910 ndr->depth--;
13911 ndr->depth--;
13913 if (flags & NDR_OUT) {
13914 ndr_print_struct(ndr, "out", "drsuapi_DsReplicaGetInfo");
13915 ndr->depth++;
13916 ndr_print_ptr(ndr, "info_type", r->out.info_type);
13917 ndr->depth++;
13918 ndr_print_drsuapi_DsReplicaInfoType(ndr, "info_type", *r->out.info_type);
13919 ndr->depth--;
13920 ndr_print_ptr(ndr, "info", r->out.info);
13921 ndr->depth++;
13922 ndr_print_set_switch_value(ndr, r->out.info, *r->out.info_type);
13923 ndr_print_drsuapi_DsReplicaInfo(ndr, "info", r->out.info);
13924 ndr->depth--;
13925 ndr_print_WERROR(ndr, "result", r->out.result);
13926 ndr->depth--;
13928 ndr->depth--;
13931 static enum ndr_err_code ndr_push_DRSUAPI_ADD_SID_HISTORY(struct ndr_push *ndr, int flags, const struct DRSUAPI_ADD_SID_HISTORY *r)
13933 if (flags & NDR_IN) {
13935 if (flags & NDR_OUT) {
13936 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
13938 return NDR_ERR_SUCCESS;
13941 static enum ndr_err_code ndr_pull_DRSUAPI_ADD_SID_HISTORY(struct ndr_pull *ndr, int flags, struct DRSUAPI_ADD_SID_HISTORY *r)
13943 if (flags & NDR_IN) {
13945 if (flags & NDR_OUT) {
13946 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
13948 return NDR_ERR_SUCCESS;
13951 _PUBLIC_ void ndr_print_DRSUAPI_ADD_SID_HISTORY(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_ADD_SID_HISTORY *r)
13953 ndr_print_struct(ndr, name, "DRSUAPI_ADD_SID_HISTORY");
13954 ndr->depth++;
13955 if (flags & NDR_SET_VALUES) {
13956 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
13958 if (flags & NDR_IN) {
13959 ndr_print_struct(ndr, "in", "DRSUAPI_ADD_SID_HISTORY");
13960 ndr->depth++;
13961 ndr->depth--;
13963 if (flags & NDR_OUT) {
13964 ndr_print_struct(ndr, "out", "DRSUAPI_ADD_SID_HISTORY");
13965 ndr->depth++;
13966 ndr_print_WERROR(ndr, "result", r->out.result);
13967 ndr->depth--;
13969 ndr->depth--;
13972 static enum ndr_err_code ndr_push_drsuapi_DsGetMemberships2(struct ndr_push *ndr, int flags, const struct drsuapi_DsGetMemberships2 *r)
13974 if (flags & NDR_IN) {
13975 if (r->in.bind_handle == NULL) {
13976 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13978 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
13979 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level));
13980 if (r->in.req == NULL) {
13981 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13983 NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level));
13984 NDR_CHECK(ndr_push_drsuapi_DsGetMemberships2Request(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req));
13986 if (flags & NDR_OUT) {
13987 if (r->out.level_out == NULL) {
13988 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13990 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, *r->out.level_out));
13991 if (r->out.ctr == NULL) {
13992 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
13994 NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.ctr, *r->out.level_out));
13995 NDR_CHECK(ndr_push_drsuapi_DsGetMemberships2Ctr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr));
13996 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
13998 return NDR_ERR_SUCCESS;
14001 static enum ndr_err_code ndr_pull_drsuapi_DsGetMemberships2(struct ndr_pull *ndr, int flags, struct drsuapi_DsGetMemberships2 *r)
14003 TALLOC_CTX *_mem_save_bind_handle_0;
14004 TALLOC_CTX *_mem_save_req_0;
14005 TALLOC_CTX *_mem_save_level_out_0;
14006 TALLOC_CTX *_mem_save_ctr_0;
14007 if (flags & NDR_IN) {
14008 ZERO_STRUCT(r->out);
14010 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14011 NDR_PULL_ALLOC(ndr, r->in.bind_handle);
14013 _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
14014 NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC);
14015 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
14016 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC);
14017 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level));
14018 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14019 NDR_PULL_ALLOC(ndr, r->in.req);
14021 _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr);
14022 NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC);
14023 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level));
14024 NDR_CHECK(ndr_pull_drsuapi_DsGetMemberships2Request(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req));
14025 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC);
14026 NDR_PULL_ALLOC(ndr, r->out.level_out);
14027 ZERO_STRUCTP(r->out.level_out);
14028 NDR_PULL_ALLOC(ndr, r->out.ctr);
14029 ZERO_STRUCTP(r->out.ctr);
14031 if (flags & NDR_OUT) {
14032 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14033 NDR_PULL_ALLOC(ndr, r->out.level_out);
14035 _mem_save_level_out_0 = NDR_PULL_GET_MEM_CTX(ndr);
14036 NDR_PULL_SET_MEM_CTX(ndr, r->out.level_out, LIBNDR_FLAG_REF_ALLOC);
14037 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, r->out.level_out));
14038 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_out_0, LIBNDR_FLAG_REF_ALLOC);
14039 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14040 NDR_PULL_ALLOC(ndr, r->out.ctr);
14042 _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr);
14043 NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC);
14044 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.ctr, *r->out.level_out));
14045 NDR_CHECK(ndr_pull_drsuapi_DsGetMemberships2Ctr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr));
14046 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC);
14047 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
14049 return NDR_ERR_SUCCESS;
14052 _PUBLIC_ void ndr_print_drsuapi_DsGetMemberships2(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_DsGetMemberships2 *r)
14054 ndr_print_struct(ndr, name, "drsuapi_DsGetMemberships2");
14055 ndr->depth++;
14056 if (flags & NDR_SET_VALUES) {
14057 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
14059 if (flags & NDR_IN) {
14060 ndr_print_struct(ndr, "in", "drsuapi_DsGetMemberships2");
14061 ndr->depth++;
14062 ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle);
14063 ndr->depth++;
14064 ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle);
14065 ndr->depth--;
14066 ndr_print_int32(ndr, "level", r->in.level);
14067 ndr_print_ptr(ndr, "req", r->in.req);
14068 ndr->depth++;
14069 ndr_print_set_switch_value(ndr, r->in.req, r->in.level);
14070 ndr_print_drsuapi_DsGetMemberships2Request(ndr, "req", r->in.req);
14071 ndr->depth--;
14072 ndr->depth--;
14074 if (flags & NDR_OUT) {
14075 ndr_print_struct(ndr, "out", "drsuapi_DsGetMemberships2");
14076 ndr->depth++;
14077 ndr_print_ptr(ndr, "level_out", r->out.level_out);
14078 ndr->depth++;
14079 ndr_print_int32(ndr, "level_out", *r->out.level_out);
14080 ndr->depth--;
14081 ndr_print_ptr(ndr, "ctr", r->out.ctr);
14082 ndr->depth++;
14083 ndr_print_set_switch_value(ndr, r->out.ctr, *r->out.level_out);
14084 ndr_print_drsuapi_DsGetMemberships2Ctr(ndr, "ctr", r->out.ctr);
14085 ndr->depth--;
14086 ndr_print_WERROR(ndr, "result", r->out.result);
14087 ndr->depth--;
14089 ndr->depth--;
14092 static enum ndr_err_code ndr_push_DRSUAPI_REPLICA_VERIFY_OBJECTS(struct ndr_push *ndr, int flags, const struct DRSUAPI_REPLICA_VERIFY_OBJECTS *r)
14094 if (flags & NDR_IN) {
14096 if (flags & NDR_OUT) {
14097 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
14099 return NDR_ERR_SUCCESS;
14102 static enum ndr_err_code ndr_pull_DRSUAPI_REPLICA_VERIFY_OBJECTS(struct ndr_pull *ndr, int flags, struct DRSUAPI_REPLICA_VERIFY_OBJECTS *r)
14104 if (flags & NDR_IN) {
14106 if (flags & NDR_OUT) {
14107 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
14109 return NDR_ERR_SUCCESS;
14112 _PUBLIC_ void ndr_print_DRSUAPI_REPLICA_VERIFY_OBJECTS(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_REPLICA_VERIFY_OBJECTS *r)
14114 ndr_print_struct(ndr, name, "DRSUAPI_REPLICA_VERIFY_OBJECTS");
14115 ndr->depth++;
14116 if (flags & NDR_SET_VALUES) {
14117 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
14119 if (flags & NDR_IN) {
14120 ndr_print_struct(ndr, "in", "DRSUAPI_REPLICA_VERIFY_OBJECTS");
14121 ndr->depth++;
14122 ndr->depth--;
14124 if (flags & NDR_OUT) {
14125 ndr_print_struct(ndr, "out", "DRSUAPI_REPLICA_VERIFY_OBJECTS");
14126 ndr->depth++;
14127 ndr_print_WERROR(ndr, "result", r->out.result);
14128 ndr->depth--;
14130 ndr->depth--;
14133 static enum ndr_err_code ndr_push_DRSUAPI_GET_OBJECT_EXISTENCE(struct ndr_push *ndr, int flags, const struct DRSUAPI_GET_OBJECT_EXISTENCE *r)
14135 if (flags & NDR_IN) {
14137 if (flags & NDR_OUT) {
14138 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
14140 return NDR_ERR_SUCCESS;
14143 static enum ndr_err_code ndr_pull_DRSUAPI_GET_OBJECT_EXISTENCE(struct ndr_pull *ndr, int flags, struct DRSUAPI_GET_OBJECT_EXISTENCE *r)
14145 if (flags & NDR_IN) {
14147 if (flags & NDR_OUT) {
14148 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
14150 return NDR_ERR_SUCCESS;
14153 _PUBLIC_ void ndr_print_DRSUAPI_GET_OBJECT_EXISTENCE(struct ndr_print *ndr, const char *name, int flags, const struct DRSUAPI_GET_OBJECT_EXISTENCE *r)
14155 ndr_print_struct(ndr, name, "DRSUAPI_GET_OBJECT_EXISTENCE");
14156 ndr->depth++;
14157 if (flags & NDR_SET_VALUES) {
14158 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
14160 if (flags & NDR_IN) {
14161 ndr_print_struct(ndr, "in", "DRSUAPI_GET_OBJECT_EXISTENCE");
14162 ndr->depth++;
14163 ndr->depth--;
14165 if (flags & NDR_OUT) {
14166 ndr_print_struct(ndr, "out", "DRSUAPI_GET_OBJECT_EXISTENCE");
14167 ndr->depth++;
14168 ndr_print_WERROR(ndr, "result", r->out.result);
14169 ndr->depth--;
14171 ndr->depth--;
14174 static enum ndr_err_code ndr_push_drsuapi_QuerySitesByCost(struct ndr_push *ndr, int flags, const struct drsuapi_QuerySitesByCost *r)
14176 if (flags & NDR_IN) {
14177 if (r->in.bind_handle == NULL) {
14178 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14180 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
14181 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->in.level));
14182 if (r->in.req == NULL) {
14183 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14185 NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.req, r->in.level));
14186 NDR_CHECK(ndr_push_drsuapi_QuerySitesByCostRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req));
14188 if (flags & NDR_OUT) {
14189 if (r->out.level_out == NULL) {
14190 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14192 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, *r->out.level_out));
14193 if (r->out.ctr == NULL) {
14194 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
14196 NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.ctr, *r->out.level_out));
14197 NDR_CHECK(ndr_push_drsuapi_QuerySitesByCostCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr));
14198 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
14200 return NDR_ERR_SUCCESS;
14203 static enum ndr_err_code ndr_pull_drsuapi_QuerySitesByCost(struct ndr_pull *ndr, int flags, struct drsuapi_QuerySitesByCost *r)
14205 TALLOC_CTX *_mem_save_bind_handle_0;
14206 TALLOC_CTX *_mem_save_req_0;
14207 TALLOC_CTX *_mem_save_level_out_0;
14208 TALLOC_CTX *_mem_save_ctr_0;
14209 if (flags & NDR_IN) {
14210 ZERO_STRUCT(r->out);
14212 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14213 NDR_PULL_ALLOC(ndr, r->in.bind_handle);
14215 _mem_save_bind_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
14216 NDR_PULL_SET_MEM_CTX(ndr, r->in.bind_handle, LIBNDR_FLAG_REF_ALLOC);
14217 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.bind_handle));
14218 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bind_handle_0, LIBNDR_FLAG_REF_ALLOC);
14219 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->in.level));
14220 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14221 NDR_PULL_ALLOC(ndr, r->in.req);
14223 _mem_save_req_0 = NDR_PULL_GET_MEM_CTX(ndr);
14224 NDR_PULL_SET_MEM_CTX(ndr, r->in.req, LIBNDR_FLAG_REF_ALLOC);
14225 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.req, r->in.level));
14226 NDR_CHECK(ndr_pull_drsuapi_QuerySitesByCostRequest(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.req));
14227 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_req_0, LIBNDR_FLAG_REF_ALLOC);
14228 NDR_PULL_ALLOC(ndr, r->out.level_out);
14229 ZERO_STRUCTP(r->out.level_out);
14230 NDR_PULL_ALLOC(ndr, r->out.ctr);
14231 ZERO_STRUCTP(r->out.ctr);
14233 if (flags & NDR_OUT) {
14234 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14235 NDR_PULL_ALLOC(ndr, r->out.level_out);
14237 _mem_save_level_out_0 = NDR_PULL_GET_MEM_CTX(ndr);
14238 NDR_PULL_SET_MEM_CTX(ndr, r->out.level_out, LIBNDR_FLAG_REF_ALLOC);
14239 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, r->out.level_out));
14240 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_out_0, LIBNDR_FLAG_REF_ALLOC);
14241 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
14242 NDR_PULL_ALLOC(ndr, r->out.ctr);
14244 _mem_save_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr);
14245 NDR_PULL_SET_MEM_CTX(ndr, r->out.ctr, LIBNDR_FLAG_REF_ALLOC);
14246 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.ctr, *r->out.level_out));
14247 NDR_CHECK(ndr_pull_drsuapi_QuerySitesByCostCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr));
14248 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ctr_0, LIBNDR_FLAG_REF_ALLOC);
14249 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
14251 return NDR_ERR_SUCCESS;
14254 _PUBLIC_ void ndr_print_drsuapi_QuerySitesByCost(struct ndr_print *ndr, const char *name, int flags, const struct drsuapi_QuerySitesByCost *r)
14256 ndr_print_struct(ndr, name, "drsuapi_QuerySitesByCost");
14257 ndr->depth++;
14258 if (flags & NDR_SET_VALUES) {
14259 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
14261 if (flags & NDR_IN) {
14262 ndr_print_struct(ndr, "in", "drsuapi_QuerySitesByCost");
14263 ndr->depth++;
14264 ndr_print_ptr(ndr, "bind_handle", r->in.bind_handle);
14265 ndr->depth++;
14266 ndr_print_policy_handle(ndr, "bind_handle", r->in.bind_handle);
14267 ndr->depth--;
14268 ndr_print_int32(ndr, "level", r->in.level);
14269 ndr_print_ptr(ndr, "req", r->in.req);
14270 ndr->depth++;
14271 ndr_print_set_switch_value(ndr, r->in.req, r->in.level);
14272 ndr_print_drsuapi_QuerySitesByCostRequest(ndr, "req", r->in.req);
14273 ndr->depth--;
14274 ndr->depth--;
14276 if (flags & NDR_OUT) {
14277 ndr_print_struct(ndr, "out", "drsuapi_QuerySitesByCost");
14278 ndr->depth++;
14279 ndr_print_ptr(ndr, "level_out", r->out.level_out);
14280 ndr->depth++;
14281 ndr_print_int32(ndr, "level_out", *r->out.level_out);
14282 ndr->depth--;
14283 ndr_print_ptr(ndr, "ctr", r->out.ctr);
14284 ndr->depth++;
14285 ndr_print_set_switch_value(ndr, r->out.ctr, *r->out.level_out);
14286 ndr_print_drsuapi_QuerySitesByCostCtr(ndr, "ctr", r->out.ctr);
14287 ndr->depth--;
14288 ndr_print_WERROR(ndr, "result", r->out.result);
14289 ndr->depth--;
14291 ndr->depth--;
14294 static const struct ndr_interface_call drsuapi_calls[] = {
14296 "drsuapi_DsBind",
14297 sizeof(struct drsuapi_DsBind),
14298 (ndr_push_flags_fn_t) ndr_push_drsuapi_DsBind,
14299 (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsBind,
14300 (ndr_print_function_t) ndr_print_drsuapi_DsBind,
14301 false,
14304 "drsuapi_DsUnbind",
14305 sizeof(struct drsuapi_DsUnbind),
14306 (ndr_push_flags_fn_t) ndr_push_drsuapi_DsUnbind,
14307 (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsUnbind,
14308 (ndr_print_function_t) ndr_print_drsuapi_DsUnbind,
14309 false,
14312 "drsuapi_DsReplicaSync",
14313 sizeof(struct drsuapi_DsReplicaSync),
14314 (ndr_push_flags_fn_t) ndr_push_drsuapi_DsReplicaSync,
14315 (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsReplicaSync,
14316 (ndr_print_function_t) ndr_print_drsuapi_DsReplicaSync,
14317 false,
14320 "drsuapi_DsGetNCChanges",
14321 sizeof(struct drsuapi_DsGetNCChanges),
14322 (ndr_push_flags_fn_t) ndr_push_drsuapi_DsGetNCChanges,
14323 (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsGetNCChanges,
14324 (ndr_print_function_t) ndr_print_drsuapi_DsGetNCChanges,
14325 false,
14328 "drsuapi_DsReplicaUpdateRefs",
14329 sizeof(struct drsuapi_DsReplicaUpdateRefs),
14330 (ndr_push_flags_fn_t) ndr_push_drsuapi_DsReplicaUpdateRefs,
14331 (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsReplicaUpdateRefs,
14332 (ndr_print_function_t) ndr_print_drsuapi_DsReplicaUpdateRefs,
14333 false,
14336 "DRSUAPI_REPLICA_ADD",
14337 sizeof(struct DRSUAPI_REPLICA_ADD),
14338 (ndr_push_flags_fn_t) ndr_push_DRSUAPI_REPLICA_ADD,
14339 (ndr_pull_flags_fn_t) ndr_pull_DRSUAPI_REPLICA_ADD,
14340 (ndr_print_function_t) ndr_print_DRSUAPI_REPLICA_ADD,
14341 false,
14344 "DRSUAPI_REPLICA_DEL",
14345 sizeof(struct DRSUAPI_REPLICA_DEL),
14346 (ndr_push_flags_fn_t) ndr_push_DRSUAPI_REPLICA_DEL,
14347 (ndr_pull_flags_fn_t) ndr_pull_DRSUAPI_REPLICA_DEL,
14348 (ndr_print_function_t) ndr_print_DRSUAPI_REPLICA_DEL,
14349 false,
14352 "DRSUAPI_REPLICA_MODIFY",
14353 sizeof(struct DRSUAPI_REPLICA_MODIFY),
14354 (ndr_push_flags_fn_t) ndr_push_DRSUAPI_REPLICA_MODIFY,
14355 (ndr_pull_flags_fn_t) ndr_pull_DRSUAPI_REPLICA_MODIFY,
14356 (ndr_print_function_t) ndr_print_DRSUAPI_REPLICA_MODIFY,
14357 false,
14360 "DRSUAPI_VERIFY_NAMES",
14361 sizeof(struct DRSUAPI_VERIFY_NAMES),
14362 (ndr_push_flags_fn_t) ndr_push_DRSUAPI_VERIFY_NAMES,
14363 (ndr_pull_flags_fn_t) ndr_pull_DRSUAPI_VERIFY_NAMES,
14364 (ndr_print_function_t) ndr_print_DRSUAPI_VERIFY_NAMES,
14365 false,
14368 "drsuapi_DsGetMemberships",
14369 sizeof(struct drsuapi_DsGetMemberships),
14370 (ndr_push_flags_fn_t) ndr_push_drsuapi_DsGetMemberships,
14371 (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsGetMemberships,
14372 (ndr_print_function_t) ndr_print_drsuapi_DsGetMemberships,
14373 false,
14376 "DRSUAPI_INTER_DOMAIN_MOVE",
14377 sizeof(struct DRSUAPI_INTER_DOMAIN_MOVE),
14378 (ndr_push_flags_fn_t) ndr_push_DRSUAPI_INTER_DOMAIN_MOVE,
14379 (ndr_pull_flags_fn_t) ndr_pull_DRSUAPI_INTER_DOMAIN_MOVE,
14380 (ndr_print_function_t) ndr_print_DRSUAPI_INTER_DOMAIN_MOVE,
14381 false,
14384 "drsuapi_DsGetNT4ChangeLog",
14385 sizeof(struct drsuapi_DsGetNT4ChangeLog),
14386 (ndr_push_flags_fn_t) ndr_push_drsuapi_DsGetNT4ChangeLog,
14387 (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsGetNT4ChangeLog,
14388 (ndr_print_function_t) ndr_print_drsuapi_DsGetNT4ChangeLog,
14389 false,
14392 "drsuapi_DsCrackNames",
14393 sizeof(struct drsuapi_DsCrackNames),
14394 (ndr_push_flags_fn_t) ndr_push_drsuapi_DsCrackNames,
14395 (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsCrackNames,
14396 (ndr_print_function_t) ndr_print_drsuapi_DsCrackNames,
14397 false,
14400 "drsuapi_DsWriteAccountSpn",
14401 sizeof(struct drsuapi_DsWriteAccountSpn),
14402 (ndr_push_flags_fn_t) ndr_push_drsuapi_DsWriteAccountSpn,
14403 (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsWriteAccountSpn,
14404 (ndr_print_function_t) ndr_print_drsuapi_DsWriteAccountSpn,
14405 false,
14408 "drsuapi_DsRemoveDSServer",
14409 sizeof(struct drsuapi_DsRemoveDSServer),
14410 (ndr_push_flags_fn_t) ndr_push_drsuapi_DsRemoveDSServer,
14411 (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsRemoveDSServer,
14412 (ndr_print_function_t) ndr_print_drsuapi_DsRemoveDSServer,
14413 false,
14416 "DRSUAPI_REMOVE_DS_DOMAIN",
14417 sizeof(struct DRSUAPI_REMOVE_DS_DOMAIN),
14418 (ndr_push_flags_fn_t) ndr_push_DRSUAPI_REMOVE_DS_DOMAIN,
14419 (ndr_pull_flags_fn_t) ndr_pull_DRSUAPI_REMOVE_DS_DOMAIN,
14420 (ndr_print_function_t) ndr_print_DRSUAPI_REMOVE_DS_DOMAIN,
14421 false,
14424 "drsuapi_DsGetDomainControllerInfo",
14425 sizeof(struct drsuapi_DsGetDomainControllerInfo),
14426 (ndr_push_flags_fn_t) ndr_push_drsuapi_DsGetDomainControllerInfo,
14427 (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsGetDomainControllerInfo,
14428 (ndr_print_function_t) ndr_print_drsuapi_DsGetDomainControllerInfo,
14429 false,
14432 "drsuapi_DsAddEntry",
14433 sizeof(struct drsuapi_DsAddEntry),
14434 (ndr_push_flags_fn_t) ndr_push_drsuapi_DsAddEntry,
14435 (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsAddEntry,
14436 (ndr_print_function_t) ndr_print_drsuapi_DsAddEntry,
14437 false,
14440 "DRSUAPI_EXECUTE_KCC",
14441 sizeof(struct DRSUAPI_EXECUTE_KCC),
14442 (ndr_push_flags_fn_t) ndr_push_DRSUAPI_EXECUTE_KCC,
14443 (ndr_pull_flags_fn_t) ndr_pull_DRSUAPI_EXECUTE_KCC,
14444 (ndr_print_function_t) ndr_print_DRSUAPI_EXECUTE_KCC,
14445 false,
14448 "drsuapi_DsReplicaGetInfo",
14449 sizeof(struct drsuapi_DsReplicaGetInfo),
14450 (ndr_push_flags_fn_t) ndr_push_drsuapi_DsReplicaGetInfo,
14451 (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsReplicaGetInfo,
14452 (ndr_print_function_t) ndr_print_drsuapi_DsReplicaGetInfo,
14453 false,
14456 "DRSUAPI_ADD_SID_HISTORY",
14457 sizeof(struct DRSUAPI_ADD_SID_HISTORY),
14458 (ndr_push_flags_fn_t) ndr_push_DRSUAPI_ADD_SID_HISTORY,
14459 (ndr_pull_flags_fn_t) ndr_pull_DRSUAPI_ADD_SID_HISTORY,
14460 (ndr_print_function_t) ndr_print_DRSUAPI_ADD_SID_HISTORY,
14461 false,
14464 "drsuapi_DsGetMemberships2",
14465 sizeof(struct drsuapi_DsGetMemberships2),
14466 (ndr_push_flags_fn_t) ndr_push_drsuapi_DsGetMemberships2,
14467 (ndr_pull_flags_fn_t) ndr_pull_drsuapi_DsGetMemberships2,
14468 (ndr_print_function_t) ndr_print_drsuapi_DsGetMemberships2,
14469 false,
14472 "DRSUAPI_REPLICA_VERIFY_OBJECTS",
14473 sizeof(struct DRSUAPI_REPLICA_VERIFY_OBJECTS),
14474 (ndr_push_flags_fn_t) ndr_push_DRSUAPI_REPLICA_VERIFY_OBJECTS,
14475 (ndr_pull_flags_fn_t) ndr_pull_DRSUAPI_REPLICA_VERIFY_OBJECTS,
14476 (ndr_print_function_t) ndr_print_DRSUAPI_REPLICA_VERIFY_OBJECTS,
14477 false,
14480 "DRSUAPI_GET_OBJECT_EXISTENCE",
14481 sizeof(struct DRSUAPI_GET_OBJECT_EXISTENCE),
14482 (ndr_push_flags_fn_t) ndr_push_DRSUAPI_GET_OBJECT_EXISTENCE,
14483 (ndr_pull_flags_fn_t) ndr_pull_DRSUAPI_GET_OBJECT_EXISTENCE,
14484 (ndr_print_function_t) ndr_print_DRSUAPI_GET_OBJECT_EXISTENCE,
14485 false,
14488 "drsuapi_QuerySitesByCost",
14489 sizeof(struct drsuapi_QuerySitesByCost),
14490 (ndr_push_flags_fn_t) ndr_push_drsuapi_QuerySitesByCost,
14491 (ndr_pull_flags_fn_t) ndr_pull_drsuapi_QuerySitesByCost,
14492 (ndr_print_function_t) ndr_print_drsuapi_QuerySitesByCost,
14493 false,
14495 { NULL, 0, NULL, NULL, NULL, false }
14498 static const char * const drsuapi_endpoint_strings[] = {
14499 "ncacn_np:[\\pipe\\lsass]",
14500 "ncacn_np:[\\pipe\\protected_storage]",
14501 "ncacn_ip_tcp:",
14502 "ncalrpc:",
14505 static const struct ndr_interface_string_array drsuapi_endpoints = {
14506 .count = 4,
14507 .names = drsuapi_endpoint_strings
14510 static const char * const drsuapi_authservice_strings[] = {
14511 "ldap",
14514 static const struct ndr_interface_string_array drsuapi_authservices = {
14515 .count = 1,
14516 .names = drsuapi_authservice_strings
14520 const struct ndr_interface_table ndr_table_drsuapi = {
14521 .name = "drsuapi",
14522 .syntax_id = {
14523 {0xe3514235,0x4b06,0x11d1,{0xab,0x04},{0x00,0xc0,0x4f,0xc2,0xdc,0xd2}},
14524 NDR_DRSUAPI_VERSION
14526 .helpstring = NDR_DRSUAPI_HELPSTRING,
14527 .num_calls = 25,
14528 .calls = drsuapi_calls,
14529 .endpoints = &drsuapi_endpoints,
14530 .authservices = &drsuapi_authservices