Add new script for building IDL files in librpc/idl, generating both
[sfrench/samba-autobuild/.git] / librpc / gen_ndr / ndr_drsuapi.c
1 /* parser auto-generated by pidl */
2
3 #include "includes.h"
4 #include "../librpc/gen_ndr/ndr_drsuapi.h"
5
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)
11 {
12         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
13         return NDR_ERR_SUCCESS;
14 }
15
16 static enum ndr_err_code ndr_pull_drsuapi_SupportedExtensions(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
17 {
18         uint32_t v;
19         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
20         *r = v;
21         return NDR_ERR_SUCCESS;
22 }
23
24 _PUBLIC_ void ndr_print_drsuapi_SupportedExtensions(struct ndr_print *ndr, const char *name, uint32_t r)
25 {
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--;
63 }
64
65 static enum ndr_err_code ndr_push_drsuapi_SupportedExtensionsExt(struct ndr_push *ndr, int ndr_flags, uint32_t r)
66 {
67         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
68         return NDR_ERR_SUCCESS;
69 }
70
71 static enum ndr_err_code ndr_pull_drsuapi_SupportedExtensionsExt(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
72 {
73         uint32_t v;
74         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
75         *r = v;
76         return NDR_ERR_SUCCESS;
77 }
78
79 _PUBLIC_ void ndr_print_drsuapi_SupportedExtensionsExt(struct ndr_print *ndr, const char *name, uint32_t r)
80 {
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--;
86 }
87
88 static enum ndr_err_code ndr_push_drsuapi_DsBindInfo24(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsBindInfo24 *r)
89 {
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));
95         }
96         if (ndr_flags & NDR_BUFFERS) {
97         }
98         return NDR_ERR_SUCCESS;
99 }
100
101 static enum ndr_err_code ndr_pull_drsuapi_DsBindInfo24(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsBindInfo24 *r)
102 {
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));
108         }
109         if (ndr_flags & NDR_BUFFERS) {
110         }
111         return NDR_ERR_SUCCESS;
112 }
113
114 _PUBLIC_ void ndr_print_drsuapi_DsBindInfo24(struct ndr_print *ndr, const char *name, const struct drsuapi_DsBindInfo24 *r)
115 {
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--;
122 }
123
124 static enum ndr_err_code ndr_push_drsuapi_DsBindInfo28(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsBindInfo28 *r)
125 {
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));
132         }
133         if (ndr_flags & NDR_BUFFERS) {
134         }
135         return NDR_ERR_SUCCESS;
136 }
137
138 static enum ndr_err_code ndr_pull_drsuapi_DsBindInfo28(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsBindInfo28 *r)
139 {
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));
146         }
147         if (ndr_flags & NDR_BUFFERS) {
148         }
149         return NDR_ERR_SUCCESS;
150 }
151
152 _PUBLIC_ void ndr_print_drsuapi_DsBindInfo28(struct ndr_print *ndr, const char *name, const struct drsuapi_DsBindInfo28 *r)
153 {
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--;
161 }
162
163 static enum ndr_err_code ndr_push_drsuapi_DsBindInfo48(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsBindInfo48 *r)
164 {
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));
173         }
174         if (ndr_flags & NDR_BUFFERS) {
175         }
176         return NDR_ERR_SUCCESS;
177 }
178
179 static enum ndr_err_code ndr_pull_drsuapi_DsBindInfo48(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsBindInfo48 *r)
180 {
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));
189         }
190         if (ndr_flags & NDR_BUFFERS) {
191         }
192         return NDR_ERR_SUCCESS;
193 }
194
195 _PUBLIC_ void ndr_print_drsuapi_DsBindInfo48(struct ndr_print *ndr, const char *name, const struct drsuapi_DsBindInfo48 *r)
196 {
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--;
206 }
207
208 static enum ndr_err_code ndr_push_drsuapi_DsBindInfoFallBack(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsBindInfoFallBack *r)
209 {
210         if (ndr_flags & NDR_SCALARS) {
211                 NDR_CHECK(ndr_push_align(ndr, 4));
212                 {
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;
217                 }
218         }
219         if (ndr_flags & NDR_BUFFERS) {
220         }
221         return NDR_ERR_SUCCESS;
222 }
223
224 static enum ndr_err_code ndr_pull_drsuapi_DsBindInfoFallBack(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsBindInfoFallBack *r)
225 {
226         if (ndr_flags & NDR_SCALARS) {
227                 NDR_CHECK(ndr_pull_align(ndr, 4));
228                 {
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;
233                 }
234         }
235         if (ndr_flags & NDR_BUFFERS) {
236         }
237         return NDR_ERR_SUCCESS;
238 }
239
240 _PUBLIC_ void ndr_print_drsuapi_DsBindInfoFallBack(struct ndr_print *ndr, const char *name, const struct drsuapi_DsBindInfoFallBack *r)
241 {
242         ndr_print_struct(ndr, name, "drsuapi_DsBindInfoFallBack");
243         ndr->depth++;
244         ndr_print_DATA_BLOB(ndr, "info", r->info);
245         ndr->depth--;
246 }
247
248 static enum ndr_err_code ndr_push_drsuapi_DsBindInfo(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsBindInfo *r)
249 {
250         if (ndr_flags & NDR_SCALARS) {
251                 int level = ndr_push_get_switch_value(ndr, r);
252                 switch (level) {
253                         case 24: {
254                                 {
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));
259                                 }
260                         break; }
261
262                         case 28: {
263                                 {
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));
268                                 }
269                         break; }
270
271                         case 48: {
272                                 {
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));
277                                 }
278                         break; }
279
280                         default: {
281                                 {
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));
286                                 }
287                         break; }
288
289                 }
290         }
291         if (ndr_flags & NDR_BUFFERS) {
292                 int level = ndr_push_get_switch_value(ndr, r);
293                 switch (level) {
294                         case 24:
295                         break;
296
297                         case 28:
298                         break;
299
300                         case 48:
301                         break;
302
303                         default:
304                         break;
305
306                 }
307         }
308         return NDR_ERR_SUCCESS;
309 }
310
311 static enum ndr_err_code ndr_pull_drsuapi_DsBindInfo(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsBindInfo *r)
312 {
313         int level;
314         level = ndr_pull_get_switch_value(ndr, r);
315         if (ndr_flags & NDR_SCALARS) {
316                 switch (level) {
317                         case 24: {
318                                 {
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));
323                                 }
324                         break; }
325
326                         case 28: {
327                                 {
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));
332                                 }
333                         break; }
334
335                         case 48: {
336                                 {
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));
341                                 }
342                         break; }
343
344                         default: {
345                                 {
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));
350                                 }
351                         break; }
352
353                 }
354         }
355         if (ndr_flags & NDR_BUFFERS) {
356                 switch (level) {
357                         case 24:
358                         break;
359
360                         case 28:
361                         break;
362
363                         case 48:
364                         break;
365
366                         default:
367                         break;
368
369                 }
370         }
371         return NDR_ERR_SUCCESS;
372 }
373
374 _PUBLIC_ void ndr_print_drsuapi_DsBindInfo(struct ndr_print *ndr, const char *name, const union drsuapi_DsBindInfo *r)
375 {
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;
383
384                 case 28:
385                         ndr_print_drsuapi_DsBindInfo28(ndr, "info28", &r->info28);
386                 break;
387
388                 case 48:
389                         ndr_print_drsuapi_DsBindInfo48(ndr, "info48", &r->info48);
390                 break;
391
392                 default:
393                         ndr_print_drsuapi_DsBindInfoFallBack(ndr, "FallBack", &r->FallBack);
394                 break;
395
396         }
397 }
398
399 static enum ndr_err_code ndr_push_drsuapi_DsBindInfoCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsBindInfoCtr *r)
400 {
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));
406         }
407         if (ndr_flags & NDR_BUFFERS) {
408         }
409         return NDR_ERR_SUCCESS;
410 }
411
412 static enum ndr_err_code ndr_pull_drsuapi_DsBindInfoCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsBindInfoCtr *r)
413 {
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");
419                 }
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));
422         }
423         if (ndr_flags & NDR_BUFFERS) {
424         }
425         return NDR_ERR_SUCCESS;
426 }
427
428 _PUBLIC_ void ndr_print_drsuapi_DsBindInfoCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsBindInfoCtr *r)
429 {
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--;
436 }
437
438 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectIdentifier(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectIdentifier *r)
439 {
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->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));
449         }
450         if (ndr_flags & NDR_BUFFERS) {
451                 NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_BUFFERS, &r->sid));
452         }
453         return NDR_ERR_SUCCESS;
454 }
455
456 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectIdentifier(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectIdentifier *r)
457 {
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));
469                 }
470         }
471         if (ndr_flags & NDR_BUFFERS) {
472                 NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_BUFFERS, &r->sid));
473         }
474         return NDR_ERR_SUCCESS;
475 }
476
477 _PUBLIC_ void ndr_print_drsuapi_DsReplicaObjectIdentifier(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjectIdentifier *r)
478 {
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->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--;
488 }
489
490 _PUBLIC_ size_t ndr_size_drsuapi_DsReplicaObjectIdentifier(const struct drsuapi_DsReplicaObjectIdentifier *r, int flags)
491 {
492         return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier);
493 }
494
495 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaSyncOptions(struct ndr_push *ndr, int ndr_flags, uint32_t r)
496 {
497         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
498         return NDR_ERR_SUCCESS;
499 }
500
501 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaSyncOptions(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
502 {
503         uint32_t v;
504         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
505         *r = v;
506         return NDR_ERR_SUCCESS;
507 }
508
509 _PUBLIC_ void ndr_print_drsuapi_DsReplicaSyncOptions(struct ndr_print *ndr, const char *name, uint32_t r)
510 {
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--;
538 }
539
540 static enum ndr_err_code ndr_push_drsuapi_DsReplicaSyncRequest1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaSyncRequest1 *r)
541 {
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));
546                 {
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;
551                 }
552                 NDR_CHECK(ndr_push_drsuapi_DsReplicaSyncOptions(ndr, NDR_SCALARS, r->options));
553         }
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));
557                 }
558                 {
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));
563                         }
564                         ndr->flags = _flags_save_string;
565                 }
566         }
567         return NDR_ERR_SUCCESS;
568 }
569
570 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaSyncRequest1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaSyncRequest1 *r)
571 {
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;
583                 }
584                 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_guid));
585                 {
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;
593                         }
594                         ndr->flags = _flags_save_string;
595                 }
596                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaSyncOptions(ndr, NDR_SCALARS, &r->options));
597         }
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);
604                 }
605                 {
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);
613                         }
614                         ndr->flags = _flags_save_string;
615                 }
616         }
617         return NDR_ERR_SUCCESS;
618 }
619
620 _PUBLIC_ void ndr_print_drsuapi_DsReplicaSyncRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaSyncRequest1 *r)
621 {
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);
628         }
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);
635         }
636         ndr->depth--;
637         ndr_print_drsuapi_DsReplicaSyncOptions(ndr, "options", r->options);
638         ndr->depth--;
639 }
640
641 static enum ndr_err_code ndr_push_drsuapi_DsReplicaSyncRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsReplicaSyncRequest *r)
642 {
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; }
650
651                         default:
652                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
653                 }
654         }
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;
661
662                         default:
663                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
664                 }
665         }
666         return NDR_ERR_SUCCESS;
667 }
668
669 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaSyncRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsReplicaSyncRequest *r)
670 {
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);
678                 }
679                 switch (level) {
680                         case 1: {
681                                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaSyncRequest1(ndr, NDR_SCALARS, &r->req1));
682                         break; }
683
684                         default:
685                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
686                 }
687         }
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;
693
694                         default:
695                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
696                 }
697         }
698         return NDR_ERR_SUCCESS;
699 }
700
701 _PUBLIC_ void ndr_print_drsuapi_DsReplicaSyncRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsReplicaSyncRequest *r)
702 {
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;
710
711                 default:
712                         ndr_print_bad_level(ndr, name, level);
713         }
714 }
715
716 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaHighWaterMark(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaHighWaterMark *r)
717 {
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));
723         }
724         if (ndr_flags & NDR_BUFFERS) {
725         }
726         return NDR_ERR_SUCCESS;
727 }
728
729 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaHighWaterMark(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaHighWaterMark *r)
730 {
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));
736         }
737         if (ndr_flags & NDR_BUFFERS) {
738         }
739         return NDR_ERR_SUCCESS;
740 }
741
742 _PUBLIC_ void ndr_print_drsuapi_DsReplicaHighWaterMark(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaHighWaterMark *r)
743 {
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--;
750 }
751
752 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaCursor(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursor *r)
753 {
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));
758         }
759         if (ndr_flags & NDR_BUFFERS) {
760         }
761         return NDR_ERR_SUCCESS;
762 }
763
764 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursor(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursor *r)
765 {
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));
770         }
771         if (ndr_flags & NDR_BUFFERS) {
772         }
773         return NDR_ERR_SUCCESS;
774 }
775
776 _PUBLIC_ void ndr_print_drsuapi_DsReplicaCursor(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursor *r)
777 {
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--;
783 }
784
785 static enum ndr_err_code ndr_push_drsuapi_DsReplicaCursorCtrEx(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursorCtrEx *r)
786 {
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]));
797                 }
798         }
799         if (ndr_flags & NDR_BUFFERS) {
800         }
801         return NDR_ERR_SUCCESS;
802 }
803
804 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursorCtrEx(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursorCtrEx *r)
805 {
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 < 0 || r->count > 0x100000) {
815                         return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
816                 }
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]));
823                 }
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));
827                 }
828         }
829         if (ndr_flags & NDR_BUFFERS) {
830         }
831         return NDR_ERR_SUCCESS;
832 }
833
834 _PUBLIC_ void ndr_print_drsuapi_DsReplicaCursorCtrEx(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursorCtrEx *r)
835 {
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);
850                 }
851         }
852         ndr->depth--;
853         ndr->depth--;
854 }
855
856 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaNeighbourFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
857 {
858         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
859         return NDR_ERR_SUCCESS;
860 }
861
862 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaNeighbourFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
863 {
864         uint32_t v;
865         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
866         *r = v;
867         return NDR_ERR_SUCCESS;
868 }
869
870 _PUBLIC_ void ndr_print_drsuapi_DsReplicaNeighbourFlags(struct ndr_print *ndr, const char *name, uint32_t r)
871 {
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--;
890 }
891
892 static enum ndr_err_code ndr_push_drsuapi_DsExtendedOperation(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsExtendedOperation r)
893 {
894         {
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;
899         }
900         return NDR_ERR_SUCCESS;
901 }
902
903 static enum ndr_err_code ndr_pull_drsuapi_DsExtendedOperation(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsExtendedOperation *r)
904 {
905         uint32_t v;
906         {
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;
912         }
913         return NDR_ERR_SUCCESS;
914 }
915
916 _PUBLIC_ void ndr_print_drsuapi_DsExtendedOperation(struct ndr_print *ndr, const char *name, enum drsuapi_DsExtendedOperation r)
917 {
918         const char *val = NULL;
919
920         {
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;
932                 }
933                 ndr_print_enum(ndr, name, "ENUM", val, r);
934                 ndr->flags = _flags_save_ENUM;
935         }
936 }
937
938 static enum ndr_err_code ndr_push_drsuapi_DsExtendedError(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsExtendedError r)
939 {
940         {
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;
945         }
946         return NDR_ERR_SUCCESS;
947 }
948
949 static enum ndr_err_code ndr_pull_drsuapi_DsExtendedError(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsExtendedError *r)
950 {
951         uint32_t v;
952         {
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;
958         }
959         return NDR_ERR_SUCCESS;
960 }
961
962 _PUBLIC_ void ndr_print_drsuapi_DsExtendedError(struct ndr_print *ndr, const char *name, enum drsuapi_DsExtendedError r)
963 {
964         const char *val = NULL;
965
966         {
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;
987                 }
988                 ndr_print_enum(ndr, name, "ENUM", val, r);
989                 ndr->flags = _flags_save_ENUM;
990         }
991 }
992
993 static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesRequest5(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesRequest5 *r)
994 {
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");
1001                 }
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));
1010         }
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));
1015                 }
1016         }
1017         return NDR_ERR_SUCCESS;
1018 }
1019
1020 static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesRequest5(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesRequest5 *r)
1021 {
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;
1035                 }
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;
1042                 }
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));
1048         }
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);
1059                 }
1060         }
1061         return NDR_ERR_SUCCESS;
1062 }
1063
1064 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesRequest5(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesRequest5 *r)
1065 {
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);
1079         }
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--;
1087 }
1088
1089 _PUBLIC_ void ndr_print_drsuapi_DsReplicaOID(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaOID *r)
1090 {
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);
1098         }
1099         ndr->depth--;
1100         ndr->depth--;
1101 }
1102
1103 static enum ndr_err_code ndr_push_drsuapi_DsReplicaOIDMapping(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaOIDMapping *r)
1104 {
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));
1109         }
1110         if (ndr_flags & NDR_BUFFERS) {
1111                 NDR_CHECK(ndr_push_drsuapi_DsReplicaOID(ndr, NDR_BUFFERS, &r->oid));
1112         }
1113         return NDR_ERR_SUCCESS;
1114 }
1115
1116 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaOIDMapping(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaOIDMapping *r)
1117 {
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));
1122         }
1123         if (ndr_flags & NDR_BUFFERS) {
1124                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOID(ndr, NDR_BUFFERS, &r->oid));
1125         }
1126         return NDR_ERR_SUCCESS;
1127 }
1128
1129 _PUBLIC_ void ndr_print_drsuapi_DsReplicaOIDMapping(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaOIDMapping *r)
1130 {
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--;
1136 }
1137
1138 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaOIDMapping_Ctr *r)
1139 {
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));
1145         }
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]));
1151                         }
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]));
1154                         }
1155                 }
1156         }
1157         return NDR_ERR_SUCCESS;
1158 }
1159
1160 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaOIDMapping_Ctr *r)
1161 {
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 < 0 || r->num_mappings > 0x100000) {
1170                         return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
1171                 }
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;
1177                 }
1178         }
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]));
1189                         }
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]));
1192                         }
1193                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_mappings_1, 0);
1194                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_mappings_0, 0);
1195                 }
1196                 if (r->mappings) {
1197                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->mappings, r->num_mappings));
1198                 }
1199         }
1200         return NDR_ERR_SUCCESS;
1201 }
1202
1203 _PUBLIC_ void ndr_print_drsuapi_DsReplicaOIDMapping_Ctr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaOIDMapping_Ctr *r)
1204 {
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);
1219                         }
1220                 }
1221                 ndr->depth--;
1222         }
1223         ndr->depth--;
1224         ndr->depth--;
1225 }
1226
1227 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsAttributeId(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsAttributeId r)
1228 {
1229         {
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;
1234         }
1235         return NDR_ERR_SUCCESS;
1236 }
1237
1238 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsAttributeId(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsAttributeId *r)
1239 {
1240         uint32_t v;
1241         {
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;
1247         }
1248         return NDR_ERR_SUCCESS;
1249 }
1250
1251 _PUBLIC_ void ndr_print_drsuapi_DsAttributeId(struct ndr_print *ndr, const char *name, enum drsuapi_DsAttributeId r)
1252 {
1253         const char *val = NULL;
1254
1255         {
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;
1320                 }
1321                 ndr_print_enum(ndr, name, "ENUM", val, r);
1322                 ndr->flags = _flags_save_ENUM;
1323         }
1324 }
1325
1326 static enum ndr_err_code ndr_push_drsuapi_DsPartialAttributeSet(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsPartialAttributeSet *r)
1327 {
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]));
1337                 }
1338         }
1339         if (ndr_flags & NDR_BUFFERS) {
1340         }
1341         return NDR_ERR_SUCCESS;
1342 }
1343
1344 static enum ndr_err_code ndr_pull_drsuapi_DsPartialAttributeSet(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsPartialAttributeSet *r)
1345 {
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");
1356                 }
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]));
1362                 }
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));
1366                 }
1367         }
1368         if (ndr_flags & NDR_BUFFERS) {
1369         }
1370         return NDR_ERR_SUCCESS;
1371 }
1372
1373 _PUBLIC_ void ndr_print_drsuapi_DsPartialAttributeSet(struct ndr_print *ndr, const char *name, const struct drsuapi_DsPartialAttributeSet *r)
1374 {
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);
1388                 }
1389         }
1390         ndr->depth--;
1391         ndr->depth--;
1392 }
1393
1394 static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesRequest8(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesRequest8 *r)
1395 {
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");
1402                 }
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));
1414         }
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));
1419                 }
1420                 if (r->partial_attribute_set) {
1421                         NDR_CHECK(ndr_push_drsuapi_DsPartialAttributeSet(ndr, NDR_SCALARS, r->partial_attribute_set));
1422                 }
1423                 if (r->partial_attribute_set_ex) {
1424                         NDR_CHECK(ndr_push_drsuapi_DsPartialAttributeSet(ndr, NDR_SCALARS, r->partial_attribute_set_ex));
1425                 }
1426                 NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->mapping_ctr));
1427         }
1428         return NDR_ERR_SUCCESS;
1429 }
1430
1431 static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesRequest8(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesRequest8 *r)
1432 {
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;
1450                 }
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;
1457                 }
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;
1468                 }
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;
1474                 }
1475                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_SCALARS, &r->mapping_ctr));
1476         }
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);
1487                 }
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);
1493                 }
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);
1499                 }
1500                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->mapping_ctr));
1501         }
1502         return NDR_ERR_SUCCESS;
1503 }
1504
1505 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesRequest8(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesRequest8 *r)
1506 {
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);
1520         }
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);
1531         }
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);
1537         }
1538         ndr->depth--;
1539         ndr_print_drsuapi_DsReplicaOIDMapping_Ctr(ndr, "mapping_ctr", &r->mapping_ctr);
1540         ndr->depth--;
1541 }
1542
1543 static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetNCChangesRequest *r)
1544 {
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; }
1552
1553                         case 8: {
1554                                 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesRequest8(ndr, NDR_SCALARS, &r->req8));
1555                         break; }
1556
1557                         default:
1558                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1559                 }
1560         }
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;
1567
1568                         case 8:
1569                                 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesRequest8(ndr, NDR_BUFFERS, &r->req8));
1570                         break;
1571
1572                         default:
1573                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1574                 }
1575         }
1576         return NDR_ERR_SUCCESS;
1577 }
1578
1579 static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetNCChangesRequest *r)
1580 {
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);
1588                 }
1589                 switch (level) {
1590                         case 5: {
1591                                 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesRequest5(ndr, NDR_SCALARS, &r->req5));
1592                         break; }
1593
1594                         case 8: {
1595                                 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesRequest8(ndr, NDR_SCALARS, &r->req8));
1596                         break; }
1597
1598                         default:
1599                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1600                 }
1601         }
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;
1607
1608                         case 8:
1609                                 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesRequest8(ndr, NDR_BUFFERS, &r->req8));
1610                         break;
1611
1612                         default:
1613                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1614                 }
1615         }
1616         return NDR_ERR_SUCCESS;
1617 }
1618
1619 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetNCChangesRequest *r)
1620 {
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;
1628
1629                 case 8:
1630                         ndr_print_drsuapi_DsGetNCChangesRequest8(ndr, "req8", &r->req8);
1631                 break;
1632
1633                 default:
1634                         ndr_print_bad_level(ndr, name, level);
1635         }
1636 }
1637
1638 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaCursor2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursor2 *r)
1639 {
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));
1645         }
1646         if (ndr_flags & NDR_BUFFERS) {
1647         }
1648         return NDR_ERR_SUCCESS;
1649 }
1650
1651 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursor2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursor2 *r)
1652 {
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));
1658         }
1659         if (ndr_flags & NDR_BUFFERS) {
1660         }
1661         return NDR_ERR_SUCCESS;
1662 }
1663
1664 _PUBLIC_ void ndr_print_drsuapi_DsReplicaCursor2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursor2 *r)
1665 {
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--;
1672 }
1673
1674 static enum ndr_err_code ndr_push_drsuapi_DsReplicaCursor2CtrEx(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursor2CtrEx *r)
1675 {
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]));
1686                 }
1687         }
1688         if (ndr_flags & NDR_BUFFERS) {
1689         }
1690         return NDR_ERR_SUCCESS;
1691 }
1692
1693 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursor2CtrEx(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursor2CtrEx *r)
1694 {
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 < 0 || r->count > 0x100000) {
1704                         return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
1705                 }
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]));
1712                 }
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));
1716                 }
1717         }
1718         if (ndr_flags & NDR_BUFFERS) {
1719         }
1720         return NDR_ERR_SUCCESS;
1721 }
1722
1723 _PUBLIC_ void ndr_print_drsuapi_DsReplicaCursor2CtrEx(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursor2CtrEx *r)
1724 {
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);
1739                 }
1740         }
1741         ndr->depth--;
1742         ndr->depth--;
1743 }
1744
1745 static enum ndr_err_code ndr_push_drsuapi_DsAttributeValue(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAttributeValue *r)
1746 {
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));
1751         }
1752         if (ndr_flags & NDR_BUFFERS) {
1753                 if (r->blob) {
1754                         NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, *r->blob));
1755                 }
1756         }
1757         return NDR_ERR_SUCCESS;
1758 }
1759
1760 static enum ndr_err_code ndr_pull_drsuapi_DsAttributeValue(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAttributeValue *r)
1761 {
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 < 0 || r->__ndr_size > 10485760) {
1768                         return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
1769                 }
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;
1775                 }
1776         }
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);
1783                 }
1784         }
1785         return NDR_ERR_SUCCESS;
1786 }
1787
1788 _PUBLIC_ void ndr_print_drsuapi_DsAttributeValue(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAttributeValue *r)
1789 {
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);
1797         }
1798         ndr->depth--;
1799         ndr->depth--;
1800 }
1801
1802 static enum ndr_err_code ndr_push_drsuapi_DsAttributeValueCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAttributeValueCtr *r)
1803 {
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));
1809         }
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]));
1815                         }
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]));
1818                         }
1819                 }
1820         }
1821         return NDR_ERR_SUCCESS;
1822 }
1823
1824 static enum ndr_err_code ndr_pull_drsuapi_DsAttributeValueCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAttributeValueCtr *r)
1825 {
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 < 0 || r->num_values > 10485760) {
1834                         return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
1835                 }
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;
1841                 }
1842         }
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]));
1853                         }
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]));
1856                         }
1857                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_values_1, 0);
1858                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_values_0, 0);
1859                 }
1860                 if (r->values) {
1861                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->values, r->num_values));
1862                 }
1863         }
1864         return NDR_ERR_SUCCESS;
1865 }
1866
1867 _PUBLIC_ void ndr_print_drsuapi_DsAttributeValueCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAttributeValueCtr *r)
1868 {
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);
1883                         }
1884                 }
1885                 ndr->depth--;
1886         }
1887         ndr->depth--;
1888         ndr->depth--;
1889 }
1890
1891 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectIdentifier3(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectIdentifier3 *r)
1892 {
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->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));
1901         }
1902         if (ndr_flags & NDR_BUFFERS) {
1903                 NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_BUFFERS, &r->sid));
1904         }
1905         return NDR_ERR_SUCCESS;
1906 }
1907
1908 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectIdentifier3(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectIdentifier3 *r)
1909 {
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));
1918         }
1919         if (ndr_flags & NDR_BUFFERS) {
1920                 NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_BUFFERS, &r->sid));
1921         }
1922         return NDR_ERR_SUCCESS;
1923 }
1924
1925 _PUBLIC_ void ndr_print_drsuapi_DsReplicaObjectIdentifier3(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjectIdentifier3 *r)
1926 {
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->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--;
1936 }
1937
1938 _PUBLIC_ size_t ndr_size_drsuapi_DsReplicaObjectIdentifier3(const struct drsuapi_DsReplicaObjectIdentifier3 *r, int flags)
1939 {
1940         return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3);
1941 }
1942
1943 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectIdentifier3Binary(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectIdentifier3Binary *r)
1944 {
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->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));
1954                 {
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;
1959                 }
1960         }
1961         if (ndr_flags & NDR_BUFFERS) {
1962                 NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_BUFFERS, &r->sid));
1963         }
1964         return NDR_ERR_SUCCESS;
1965 }
1966
1967 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectIdentifier3Binary(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectIdentifier3Binary *r)
1968 {
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));
1978                 {
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;
1983                 }
1984         }
1985         if (ndr_flags & NDR_BUFFERS) {
1986                 NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_BUFFERS, &r->sid));
1987         }
1988         return NDR_ERR_SUCCESS;
1989 }
1990
1991 _PUBLIC_ void ndr_print_drsuapi_DsReplicaObjectIdentifier3Binary(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjectIdentifier3Binary *r)
1992 {
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->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--;
2004 }
2005
2006 _PUBLIC_ size_t ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary(const struct drsuapi_DsReplicaObjectIdentifier3Binary *r, int flags)
2007 {
2008         return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3Binary);
2009 }
2010
2011 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaAttribute(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaAttribute *r)
2012 {
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));
2017         }
2018         if (ndr_flags & NDR_BUFFERS) {
2019                 NDR_CHECK(ndr_push_drsuapi_DsAttributeValueCtr(ndr, NDR_BUFFERS, &r->value_ctr));
2020         }
2021         return NDR_ERR_SUCCESS;
2022 }
2023
2024 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaAttribute(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaAttribute *r)
2025 {
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));
2030         }
2031         if (ndr_flags & NDR_BUFFERS) {
2032                 NDR_CHECK(ndr_pull_drsuapi_DsAttributeValueCtr(ndr, NDR_BUFFERS, &r->value_ctr));
2033         }
2034         return NDR_ERR_SUCCESS;
2035 }
2036
2037 _PUBLIC_ void ndr_print_drsuapi_DsReplicaAttribute(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaAttribute *r)
2038 {
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--;
2044 }
2045
2046 static enum ndr_err_code ndr_push_drsuapi_DsReplicaAttributeCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaAttributeCtr *r)
2047 {
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));
2053         }
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]));
2059                         }
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]));
2062                         }
2063                 }
2064         }
2065         return NDR_ERR_SUCCESS;
2066 }
2067
2068 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaAttributeCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaAttributeCtr *r)
2069 {
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 < 0 || r->num_attributes > 1048576) {
2078                         return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
2079                 }
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;
2085                 }
2086         }
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]));
2097                         }
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]));
2100                         }
2101                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attributes_1, 0);
2102                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attributes_0, 0);
2103                 }
2104                 if (r->attributes) {
2105                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->attributes, r->num_attributes));
2106                 }
2107         }
2108         return NDR_ERR_SUCCESS;
2109 }
2110
2111 _PUBLIC_ void ndr_print_drsuapi_DsReplicaAttributeCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaAttributeCtr *r)
2112 {
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);
2127                         }
2128                 }
2129                 ndr->depth--;
2130         }
2131         ndr->depth--;
2132         ndr->depth--;
2133 }
2134
2135 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
2136 {
2137         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
2138         return NDR_ERR_SUCCESS;
2139 }
2140
2141 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
2142 {
2143         uint32_t v;
2144         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
2145         *r = v;
2146         return NDR_ERR_SUCCESS;
2147 }
2148
2149 _PUBLIC_ void ndr_print_drsuapi_DsReplicaObjectFlags(struct ndr_print *ndr, const char *name, uint32_t r)
2150 {
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--;
2157 }
2158
2159 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObject(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObject *r)
2160 {
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));
2166         }
2167         if (ndr_flags & NDR_BUFFERS) {
2168                 if (r->identifier) {
2169                         NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->identifier));
2170                 }
2171                 NDR_CHECK(ndr_push_drsuapi_DsReplicaAttributeCtr(ndr, NDR_BUFFERS, &r->attribute_ctr));
2172         }
2173         return NDR_ERR_SUCCESS;
2174 }
2175
2176 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaObject(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObject *r)
2177 {
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;
2187                 }
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));
2190         }
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);
2197                 }
2198                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttributeCtr(ndr, NDR_BUFFERS, &r->attribute_ctr));
2199         }
2200         return NDR_ERR_SUCCESS;
2201 }
2202
2203 _PUBLIC_ void ndr_print_drsuapi_DsReplicaObject(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObject *r)
2204 {
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);
2211         }
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--;
2216 }
2217
2218 static enum ndr_err_code ndr_push_drsuapi_DsReplicaMetaData(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaMetaData *r)
2219 {
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));
2226         }
2227         if (ndr_flags & NDR_BUFFERS) {
2228         }
2229         return NDR_ERR_SUCCESS;
2230 }
2231
2232 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaMetaData(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaMetaData *r)
2233 {
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));
2240         }
2241         if (ndr_flags & NDR_BUFFERS) {
2242         }
2243         return NDR_ERR_SUCCESS;
2244 }
2245
2246 _PUBLIC_ void ndr_print_drsuapi_DsReplicaMetaData(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaMetaData *r)
2247 {
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--;
2255 }
2256
2257 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaMetaDataCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaMetaDataCtr *r)
2258 {
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]));
2266                 }
2267         }
2268         if (ndr_flags & NDR_BUFFERS) {
2269         }
2270         return NDR_ERR_SUCCESS;
2271 }
2272
2273 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaMetaDataCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaMetaDataCtr *r)
2274 {
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 < 0 || r->count > 1048576) {
2282                         return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
2283                 }
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]));
2289                 }
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));
2293                 }
2294         }
2295         if (ndr_flags & NDR_BUFFERS) {
2296         }
2297         return NDR_ERR_SUCCESS;
2298 }
2299
2300 _PUBLIC_ void ndr_print_drsuapi_DsReplicaMetaDataCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaMetaDataCtr *r)
2301 {
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);
2313                 }
2314         }
2315         ndr->depth--;
2316         ndr->depth--;
2317 }
2318
2319 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectListItemEx(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectListItemEx *r)
2320 {
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));
2328         }
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));
2332                 }
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));
2336                 }
2337                 if (r->meta_data_ctr) {
2338                         NDR_CHECK(ndr_push_drsuapi_DsReplicaMetaDataCtr(ndr, NDR_SCALARS, r->meta_data_ctr));
2339                 }
2340         }
2341         return NDR_ERR_SUCCESS;
2342 }
2343
2344 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectListItemEx(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectListItemEx *r)
2345 {
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;
2359                 }
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;
2367                 }
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;
2373                 }
2374         }
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);
2381                 }
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);
2388                 }
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);
2394                 }
2395         }
2396         return NDR_ERR_SUCCESS;
2397 }
2398
2399 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesCtr1 *r)
2400 {
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->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));
2415         }
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));
2419                 }
2420                 if (r->uptodateness_vector) {
2421                         NDR_CHECK(ndr_push_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->uptodateness_vector));
2422                 }
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));
2426                 }
2427         }
2428         return NDR_ERR_SUCCESS;
2429 }
2430
2431 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesCtr1 *r)
2432 {
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;
2448                 }
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;
2456                 }
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;
2466                 }
2467                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->more_data));
2468         }
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);
2475                 }
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);
2481                 }
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);
2488                 }
2489         }
2490         return NDR_ERR_SUCCESS;
2491 }
2492
2493 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr1 *r)
2494 {
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);
2503         }
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);
2511         }
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->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);
2521         }
2522         ndr->depth--;
2523         ndr_print_uint32(ndr, "more_data", r->more_data);
2524         ndr->depth--;
2525 }
2526
2527 _PUBLIC_ size_t ndr_size_drsuapi_DsGetNCChangesCtr1(const struct drsuapi_DsGetNCChangesCtr1 *r, int flags)
2528 {
2529         return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsGetNCChangesCtr1);
2530 }
2531
2532 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsLinkedAttributeFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
2533 {
2534         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
2535         return NDR_ERR_SUCCESS;
2536 }
2537
2538 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsLinkedAttributeFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
2539 {
2540         uint32_t v;
2541         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
2542         *r = v;
2543         return NDR_ERR_SUCCESS;
2544 }
2545
2546 _PUBLIC_ void ndr_print_drsuapi_DsLinkedAttributeFlags(struct ndr_print *ndr, const char *name, uint32_t r)
2547 {
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--;
2552 }
2553
2554 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaLinkedAttribute(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaLinkedAttribute *r)
2555 {
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));
2564         }
2565         if (ndr_flags & NDR_BUFFERS) {
2566                 if (r->identifier) {
2567                         NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->identifier));
2568                 }
2569                 NDR_CHECK(ndr_push_drsuapi_DsAttributeValue(ndr, NDR_BUFFERS, &r->value));
2570         }
2571         return NDR_ERR_SUCCESS;
2572 }
2573
2574 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaLinkedAttribute(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaLinkedAttribute *r)
2575 {
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;
2585                 }
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));
2591         }
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);
2598                 }
2599                 NDR_CHECK(ndr_pull_drsuapi_DsAttributeValue(ndr, NDR_BUFFERS, &r->value));
2600         }
2601         return NDR_ERR_SUCCESS;
2602 }
2603
2604 _PUBLIC_ void ndr_print_drsuapi_DsReplicaLinkedAttribute(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaLinkedAttribute *r)
2605 {
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);
2612         }
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--;
2620 }
2621
2622 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr6(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesCtr6 *r)
2623 {
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->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));
2644         }
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));
2648                 }
2649                 if (r->uptodateness_vector) {
2650                         NDR_CHECK(ndr_push_drsuapi_DsReplicaCursor2CtrEx(ndr, NDR_SCALARS, r->uptodateness_vector));
2651                 }
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));
2655                 }
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]));
2660                         }
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]));
2663                         }
2664                 }
2665         }
2666         return NDR_ERR_SUCCESS;
2667 }
2668
2669 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr6(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesCtr6 *r)
2670 {
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;
2690                 }
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;
2698                 }
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;
2708                 }
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 < 0 || r->linked_attributes_count > 1048576) {
2714                         return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
2715                 }
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;
2721                 }
2722                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->drs_error));
2723         }
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);
2730                 }
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);
2736                 }
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);
2743                 }
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]));
2753                         }
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]));
2756                         }
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);
2759                 }
2760                 if (r->linked_attributes) {
2761                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->linked_attributes, r->linked_attributes_count));
2762                 }
2763         }
2764         return NDR_ERR_SUCCESS;
2765 }
2766
2767 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCtr6(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr6 *r)
2768 {
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);
2778         }
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);
2786         }
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->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);
2796         }
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);
2812                         }
2813                 }
2814                 ndr->depth--;
2815         }
2816         ndr->depth--;
2817         ndr_print_WERROR(ndr, "drs_error", r->drs_error);
2818         ndr->depth--;
2819 }
2820
2821 _PUBLIC_ size_t ndr_size_drsuapi_DsGetNCChangesCtr6(const struct drsuapi_DsGetNCChangesCtr6 *r, int flags)
2822 {
2823         return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsGetNCChangesCtr6);
2824 }
2825
2826 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr1TS(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesCtr1TS *r)
2827 {
2828         if (ndr_flags & NDR_SCALARS) {
2829                 NDR_CHECK(ndr_push_align(ndr, 1));
2830       &nb