s4-idl: give a enum for attribute cn and a 'NONE' attribute
[ira/wip.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 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DrsOptions(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 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DrsOptions(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_DrsOptions(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_DRS_ASYNC_OP", DRSUAPI_DRS_ASYNC_OP, r);
29         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DRS_GETCHG_CHECK", DRSUAPI_DRS_GETCHG_CHECK, r);
30         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DRS_ADD_REF", DRSUAPI_DRS_ADD_REF, r);
31         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DRS_SYNC_ALL", DRSUAPI_DRS_SYNC_ALL, r);
32         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DRS_DEL_REF", DRSUAPI_DRS_DEL_REF, r);
33         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DRS_WRIT_REP", DRSUAPI_DRS_WRIT_REP, r);
34         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DRS_INIT_SYNC", DRSUAPI_DRS_INIT_SYNC, r);
35         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DRS_PER_SYNC", DRSUAPI_DRS_PER_SYNC, r);
36         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DRS_MAIL_REP", DRSUAPI_DRS_MAIL_REP, r);
37         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DRS_ASYNC_REP", DRSUAPI_DRS_ASYNC_REP, r);
38         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DRS_IGNORE_ERROR", DRSUAPI_DRS_IGNORE_ERROR, r);
39         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DRS_TWOWAY_SYNC", DRSUAPI_DRS_TWOWAY_SYNC, r);
40         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DRS_CRITICAL_ONLY", DRSUAPI_DRS_CRITICAL_ONLY, r);
41         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DRS_GET_ANC", DRSUAPI_DRS_GET_ANC, r);
42         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DRS_GET_NC_SIZE", DRSUAPI_DRS_GET_NC_SIZE, r);
43         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DRS_LOCAL_ONLY", DRSUAPI_DRS_LOCAL_ONLY, r);
44         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DRS_SYNC_BYNAME", DRSUAPI_DRS_SYNC_BYNAME, r);
45         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DRS_REF_OK", DRSUAPI_DRS_REF_OK, r);
46         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DRS_FULL_SYNC_NOW", DRSUAPI_DRS_FULL_SYNC_NOW, r);
47         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DRS_NO_SOURCE", DRSUAPI_DRS_NO_SOURCE, r);
48         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DRS_FULL_SYNC_PACKET", DRSUAPI_DRS_FULL_SYNC_PACKET, r);
49         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DRS_REF_GCSPN", DRSUAPI_DRS_REF_GCSPN, r);
50         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DRS_SPECIAL_SECRET_PROCESSING", DRSUAPI_DRS_SPECIAL_SECRET_PROCESSING, r);
51         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DRS_SYNC_FORCED", DRSUAPI_DRS_SYNC_FORCED, r);
52         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DRS_DISABLE_AUTO_SYNC", DRSUAPI_DRS_DISABLE_AUTO_SYNC, r);
53         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DRS_DISABLE_PERIODIC_SYNC", DRSUAPI_DRS_DISABLE_PERIODIC_SYNC, r);
54         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DRS_USE_COMPRESSION", DRSUAPI_DRS_USE_COMPRESSION, r);
55         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DRS_NEVER_NOTIFY", DRSUAPI_DRS_NEVER_NOTIFY, r);
56         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DRS_SYNC_PAS", DRSUAPI_DRS_SYNC_PAS, r);
57         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DRS_GET_ALL_GROUP_MEMBERSHIP", DRSUAPI_DRS_GET_ALL_GROUP_MEMBERSHIP, r);
58         ndr->depth--;
59 }
60
61 static enum ndr_err_code ndr_push_drsuapi_SupportedExtensions(struct ndr_push *ndr, int ndr_flags, uint32_t r)
62 {
63         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
64         return NDR_ERR_SUCCESS;
65 }
66
67 static enum ndr_err_code ndr_pull_drsuapi_SupportedExtensions(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
68 {
69         uint32_t v;
70         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
71         *r = v;
72         return NDR_ERR_SUCCESS;
73 }
74
75 _PUBLIC_ void ndr_print_drsuapi_SupportedExtensions(struct ndr_print *ndr, const char *name, uint32_t r)
76 {
77         ndr_print_uint32(ndr, name, r);
78         ndr->depth++;
79         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_BASE", DRSUAPI_SUPPORTED_EXTENSION_BASE, r);
80         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_ASYNC_REPLICATION", DRSUAPI_SUPPORTED_EXTENSION_ASYNC_REPLICATION, r);
81         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_REMOVEAPI", DRSUAPI_SUPPORTED_EXTENSION_REMOVEAPI, r);
82         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_MOVEREQ_V2", DRSUAPI_SUPPORTED_EXTENSION_MOVEREQ_V2, r);
83         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_GETCHG_COMPRESS", DRSUAPI_SUPPORTED_EXTENSION_GETCHG_COMPRESS, r);
84         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V1", DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V1, r);
85         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_RESTORE_USN_OPTIMIZATION", DRSUAPI_SUPPORTED_EXTENSION_RESTORE_USN_OPTIMIZATION, r);
86         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_00000080", DRSUAPI_SUPPORTED_EXTENSION_00000080, r);
87         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_KCC_EXECUTE", DRSUAPI_SUPPORTED_EXTENSION_KCC_EXECUTE, r);
88         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_ADDENTRY_V2", DRSUAPI_SUPPORTED_EXTENSION_ADDENTRY_V2, r);
89         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_LINKED_VALUE_REPLICATION", DRSUAPI_SUPPORTED_EXTENSION_LINKED_VALUE_REPLICATION, r);
90         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V2", DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V2, r);
91         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);
92         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_CRYPTO_BIND", DRSUAPI_SUPPORTED_EXTENSION_CRYPTO_BIND, r);
93         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_GET_REPL_INFO", DRSUAPI_SUPPORTED_EXTENSION_GET_REPL_INFO, r);
94         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_STRONG_ENCRYPTION", DRSUAPI_SUPPORTED_EXTENSION_STRONG_ENCRYPTION, r);
95         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V01", DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V01, r);
96         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_TRANSITIVE_MEMBERSHIP", DRSUAPI_SUPPORTED_EXTENSION_TRANSITIVE_MEMBERSHIP, r);
97         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_ADD_SID_HISTORY", DRSUAPI_SUPPORTED_EXTENSION_ADD_SID_HISTORY, r);
98         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_POST_BETA3", DRSUAPI_SUPPORTED_EXTENSION_POST_BETA3, r);
99         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_00100000", DRSUAPI_SUPPORTED_EXTENSION_00100000, r);
100         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_GET_MEMBERSHIPS2", DRSUAPI_SUPPORTED_EXTENSION_GET_MEMBERSHIPS2, r);
101         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V6", DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V6, r);
102         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_NONDOMAIN_NCS", DRSUAPI_SUPPORTED_EXTENSION_NONDOMAIN_NCS, r);
103         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V8", DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V8, r);
104         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V5", DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V5, r);
105         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V6", DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V6, r);
106         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_ADDENTRYREPLY_V3", DRSUAPI_SUPPORTED_EXTENSION_ADDENTRYREPLY_V3, r);
107         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V7", DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V7, r);
108         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_VERIFY_OBJECT", DRSUAPI_SUPPORTED_EXTENSION_VERIFY_OBJECT, r);
109         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_XPRESS_COMPRESS", DRSUAPI_SUPPORTED_EXTENSION_XPRESS_COMPRESS, r);
110         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_20000000", DRSUAPI_SUPPORTED_EXTENSION_20000000, r);
111         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_40000000", DRSUAPI_SUPPORTED_EXTENSION_40000000, r);
112         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_80000000", DRSUAPI_SUPPORTED_EXTENSION_80000000, r);
113         ndr->depth--;
114 }
115
116 static enum ndr_err_code ndr_push_drsuapi_SupportedExtensionsExt(struct ndr_push *ndr, int ndr_flags, uint32_t r)
117 {
118         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
119         return NDR_ERR_SUCCESS;
120 }
121
122 static enum ndr_err_code ndr_pull_drsuapi_SupportedExtensionsExt(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
123 {
124         uint32_t v;
125         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
126         *r = v;
127         return NDR_ERR_SUCCESS;
128 }
129
130 _PUBLIC_ void ndr_print_drsuapi_SupportedExtensionsExt(struct ndr_print *ndr, const char *name, uint32_t r)
131 {
132         ndr_print_uint32(ndr, name, r);
133         ndr->depth++;
134         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_ADAM", DRSUAPI_SUPPORTED_EXTENSION_ADAM, r);
135         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_SUPPORTED_EXTENSION_LH_BETA2", DRSUAPI_SUPPORTED_EXTENSION_LH_BETA2, r);
136         ndr->depth--;
137 }
138
139 static enum ndr_err_code ndr_push_drsuapi_DsBindInfo24(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsBindInfo24 *r)
140 {
141         if (ndr_flags & NDR_SCALARS) {
142                 NDR_CHECK(ndr_push_align(ndr, 4));
143                 NDR_CHECK(ndr_push_drsuapi_SupportedExtensions(ndr, NDR_SCALARS, r->supported_extensions));
144                 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->site_guid));
145                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pid));
146                 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
147         }
148         if (ndr_flags & NDR_BUFFERS) {
149         }
150         return NDR_ERR_SUCCESS;
151 }
152
153 static enum ndr_err_code ndr_pull_drsuapi_DsBindInfo24(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsBindInfo24 *r)
154 {
155         if (ndr_flags & NDR_SCALARS) {
156                 NDR_CHECK(ndr_pull_align(ndr, 4));
157                 NDR_CHECK(ndr_pull_drsuapi_SupportedExtensions(ndr, NDR_SCALARS, &r->supported_extensions));
158                 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->site_guid));
159                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pid));
160                 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
161         }
162         if (ndr_flags & NDR_BUFFERS) {
163         }
164         return NDR_ERR_SUCCESS;
165 }
166
167 _PUBLIC_ void ndr_print_drsuapi_DsBindInfo24(struct ndr_print *ndr, const char *name, const struct drsuapi_DsBindInfo24 *r)
168 {
169         ndr_print_struct(ndr, name, "drsuapi_DsBindInfo24");
170         ndr->depth++;
171         ndr_print_drsuapi_SupportedExtensions(ndr, "supported_extensions", r->supported_extensions);
172         ndr_print_GUID(ndr, "site_guid", &r->site_guid);
173         ndr_print_uint32(ndr, "pid", r->pid);
174         ndr->depth--;
175 }
176
177 static enum ndr_err_code ndr_push_drsuapi_DsBindInfo28(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsBindInfo28 *r)
178 {
179         if (ndr_flags & NDR_SCALARS) {
180                 NDR_CHECK(ndr_push_align(ndr, 4));
181                 NDR_CHECK(ndr_push_drsuapi_SupportedExtensions(ndr, NDR_SCALARS, r->supported_extensions));
182                 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->site_guid));
183                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pid));
184                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->repl_epoch));
185                 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
186         }
187         if (ndr_flags & NDR_BUFFERS) {
188         }
189         return NDR_ERR_SUCCESS;
190 }
191
192 static enum ndr_err_code ndr_pull_drsuapi_DsBindInfo28(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsBindInfo28 *r)
193 {
194         if (ndr_flags & NDR_SCALARS) {
195                 NDR_CHECK(ndr_pull_align(ndr, 4));
196                 NDR_CHECK(ndr_pull_drsuapi_SupportedExtensions(ndr, NDR_SCALARS, &r->supported_extensions));
197                 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->site_guid));
198                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pid));
199                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->repl_epoch));
200                 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
201         }
202         if (ndr_flags & NDR_BUFFERS) {
203         }
204         return NDR_ERR_SUCCESS;
205 }
206
207 _PUBLIC_ void ndr_print_drsuapi_DsBindInfo28(struct ndr_print *ndr, const char *name, const struct drsuapi_DsBindInfo28 *r)
208 {
209         ndr_print_struct(ndr, name, "drsuapi_DsBindInfo28");
210         ndr->depth++;
211         ndr_print_drsuapi_SupportedExtensions(ndr, "supported_extensions", r->supported_extensions);
212         ndr_print_GUID(ndr, "site_guid", &r->site_guid);
213         ndr_print_uint32(ndr, "pid", r->pid);
214         ndr_print_uint32(ndr, "repl_epoch", r->repl_epoch);
215         ndr->depth--;
216 }
217
218 static enum ndr_err_code ndr_push_drsuapi_DsBindInfo48(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsBindInfo48 *r)
219 {
220         if (ndr_flags & NDR_SCALARS) {
221                 NDR_CHECK(ndr_push_align(ndr, 4));
222                 NDR_CHECK(ndr_push_drsuapi_SupportedExtensions(ndr, NDR_SCALARS, r->supported_extensions));
223                 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->site_guid));
224                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pid));
225                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->repl_epoch));
226                 NDR_CHECK(ndr_push_drsuapi_SupportedExtensionsExt(ndr, NDR_SCALARS, r->supported_extensions_ext));
227                 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->config_dn_guid));
228                 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
229         }
230         if (ndr_flags & NDR_BUFFERS) {
231         }
232         return NDR_ERR_SUCCESS;
233 }
234
235 static enum ndr_err_code ndr_pull_drsuapi_DsBindInfo48(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsBindInfo48 *r)
236 {
237         if (ndr_flags & NDR_SCALARS) {
238                 NDR_CHECK(ndr_pull_align(ndr, 4));
239                 NDR_CHECK(ndr_pull_drsuapi_SupportedExtensions(ndr, NDR_SCALARS, &r->supported_extensions));
240                 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->site_guid));
241                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pid));
242                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->repl_epoch));
243                 NDR_CHECK(ndr_pull_drsuapi_SupportedExtensionsExt(ndr, NDR_SCALARS, &r->supported_extensions_ext));
244                 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->config_dn_guid));
245                 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
246         }
247         if (ndr_flags & NDR_BUFFERS) {
248         }
249         return NDR_ERR_SUCCESS;
250 }
251
252 _PUBLIC_ void ndr_print_drsuapi_DsBindInfo48(struct ndr_print *ndr, const char *name, const struct drsuapi_DsBindInfo48 *r)
253 {
254         ndr_print_struct(ndr, name, "drsuapi_DsBindInfo48");
255         ndr->depth++;
256         ndr_print_drsuapi_SupportedExtensions(ndr, "supported_extensions", r->supported_extensions);
257         ndr_print_GUID(ndr, "site_guid", &r->site_guid);
258         ndr_print_uint32(ndr, "pid", r->pid);
259         ndr_print_uint32(ndr, "repl_epoch", r->repl_epoch);
260         ndr_print_drsuapi_SupportedExtensionsExt(ndr, "supported_extensions_ext", r->supported_extensions_ext);
261         ndr_print_GUID(ndr, "config_dn_guid", &r->config_dn_guid);
262         ndr->depth--;
263 }
264
265 static enum ndr_err_code ndr_push_drsuapi_DsBindInfoFallBack(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsBindInfoFallBack *r)
266 {
267         if (ndr_flags & NDR_SCALARS) {
268                 NDR_CHECK(ndr_push_align(ndr, 4));
269                 {
270                         uint32_t _flags_save_DATA_BLOB = ndr->flags;
271                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
272                         NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->info));
273                         ndr->flags = _flags_save_DATA_BLOB;
274                 }
275                 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
276         }
277         if (ndr_flags & NDR_BUFFERS) {
278         }
279         return NDR_ERR_SUCCESS;
280 }
281
282 static enum ndr_err_code ndr_pull_drsuapi_DsBindInfoFallBack(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsBindInfoFallBack *r)
283 {
284         if (ndr_flags & NDR_SCALARS) {
285                 NDR_CHECK(ndr_pull_align(ndr, 4));
286                 {
287                         uint32_t _flags_save_DATA_BLOB = ndr->flags;
288                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
289                         NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->info));
290                         ndr->flags = _flags_save_DATA_BLOB;
291                 }
292                 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
293         }
294         if (ndr_flags & NDR_BUFFERS) {
295         }
296         return NDR_ERR_SUCCESS;
297 }
298
299 _PUBLIC_ void ndr_print_drsuapi_DsBindInfoFallBack(struct ndr_print *ndr, const char *name, const struct drsuapi_DsBindInfoFallBack *r)
300 {
301         ndr_print_struct(ndr, name, "drsuapi_DsBindInfoFallBack");
302         ndr->depth++;
303         ndr_print_DATA_BLOB(ndr, "info", r->info);
304         ndr->depth--;
305 }
306
307 static enum ndr_err_code ndr_push_drsuapi_DsBindInfo(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsBindInfo *r)
308 {
309         if (ndr_flags & NDR_SCALARS) {
310                 int level = ndr_push_get_switch_value(ndr, r);
311                 NDR_CHECK(ndr_push_union_align(ndr, 1));
312                 switch (level) {
313                         case 24: {
314                                 {
315                                         struct ndr_push *_ndr_info24;
316                                         NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_info24, 4, -1));
317                                         NDR_CHECK(ndr_push_drsuapi_DsBindInfo24(_ndr_info24, NDR_SCALARS, &r->info24));
318                                         NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info24, 4, -1));
319                                 }
320                         break; }
321
322                         case 28: {
323                                 {
324                                         struct ndr_push *_ndr_info28;
325                                         NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_info28, 4, -1));
326                                         NDR_CHECK(ndr_push_drsuapi_DsBindInfo28(_ndr_info28, NDR_SCALARS, &r->info28));
327                                         NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info28, 4, -1));
328                                 }
329                         break; }
330
331                         case 48: {
332                                 {
333                                         struct ndr_push *_ndr_info48;
334                                         NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_info48, 4, -1));
335                                         NDR_CHECK(ndr_push_drsuapi_DsBindInfo48(_ndr_info48, NDR_SCALARS, &r->info48));
336                                         NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info48, 4, -1));
337                                 }
338                         break; }
339
340                         default: {
341                                 {
342                                         struct ndr_push *_ndr_FallBack;
343                                         NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_FallBack, 4, -1));
344                                         NDR_CHECK(ndr_push_drsuapi_DsBindInfoFallBack(_ndr_FallBack, NDR_SCALARS, &r->FallBack));
345                                         NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_FallBack, 4, -1));
346                                 }
347                         break; }
348
349                 }
350         }
351         if (ndr_flags & NDR_BUFFERS) {
352                 int level = ndr_push_get_switch_value(ndr, r);
353                 switch (level) {
354                         case 24:
355                         break;
356
357                         case 28:
358                         break;
359
360                         case 48:
361                         break;
362
363                         default:
364                         break;
365
366                 }
367         }
368         return NDR_ERR_SUCCESS;
369 }
370
371 static enum ndr_err_code ndr_pull_drsuapi_DsBindInfo(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsBindInfo *r)
372 {
373         int level;
374         level = ndr_pull_get_switch_value(ndr, r);
375         if (ndr_flags & NDR_SCALARS) {
376                 NDR_CHECK(ndr_pull_union_align(ndr, 1));
377                 switch (level) {
378                         case 24: {
379                                 {
380                                         struct ndr_pull *_ndr_info24;
381                                         NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_info24, 4, -1));
382                                         NDR_CHECK(ndr_pull_drsuapi_DsBindInfo24(_ndr_info24, NDR_SCALARS, &r->info24));
383                                         NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_info24, 4, -1));
384                                 }
385                         break; }
386
387                         case 28: {
388                                 {
389                                         struct ndr_pull *_ndr_info28;
390                                         NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_info28, 4, -1));
391                                         NDR_CHECK(ndr_pull_drsuapi_DsBindInfo28(_ndr_info28, NDR_SCALARS, &r->info28));
392                                         NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_info28, 4, -1));
393                                 }
394                         break; }
395
396                         case 48: {
397                                 {
398                                         struct ndr_pull *_ndr_info48;
399                                         NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_info48, 4, -1));
400                                         NDR_CHECK(ndr_pull_drsuapi_DsBindInfo48(_ndr_info48, NDR_SCALARS, &r->info48));
401                                         NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_info48, 4, -1));
402                                 }
403                         break; }
404
405                         default: {
406                                 {
407                                         struct ndr_pull *_ndr_FallBack;
408                                         NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_FallBack, 4, -1));
409                                         NDR_CHECK(ndr_pull_drsuapi_DsBindInfoFallBack(_ndr_FallBack, NDR_SCALARS, &r->FallBack));
410                                         NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_FallBack, 4, -1));
411                                 }
412                         break; }
413
414                 }
415         }
416         if (ndr_flags & NDR_BUFFERS) {
417                 switch (level) {
418                         case 24:
419                         break;
420
421                         case 28:
422                         break;
423
424                         case 48:
425                         break;
426
427                         default:
428                         break;
429
430                 }
431         }
432         return NDR_ERR_SUCCESS;
433 }
434
435 _PUBLIC_ void ndr_print_drsuapi_DsBindInfo(struct ndr_print *ndr, const char *name, const union drsuapi_DsBindInfo *r)
436 {
437         int level;
438         level = ndr_print_get_switch_value(ndr, r);
439         ndr_print_union(ndr, name, level, "drsuapi_DsBindInfo");
440         switch (level) {
441                 case 24:
442                         ndr_print_drsuapi_DsBindInfo24(ndr, "info24", &r->info24);
443                 break;
444
445                 case 28:
446                         ndr_print_drsuapi_DsBindInfo28(ndr, "info28", &r->info28);
447                 break;
448
449                 case 48:
450                         ndr_print_drsuapi_DsBindInfo48(ndr, "info48", &r->info48);
451                 break;
452
453                 default:
454                         ndr_print_drsuapi_DsBindInfoFallBack(ndr, "FallBack", &r->FallBack);
455                 break;
456
457         }
458 }
459
460 static enum ndr_err_code ndr_push_drsuapi_DsBindInfoCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsBindInfoCtr *r)
461 {
462         if (ndr_flags & NDR_SCALARS) {
463                 NDR_CHECK(ndr_push_align(ndr, 4));
464                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length));
465                 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->info, r->length));
466                 NDR_CHECK(ndr_push_drsuapi_DsBindInfo(ndr, NDR_SCALARS, &r->info));
467                 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
468         }
469         if (ndr_flags & NDR_BUFFERS) {
470         }
471         return NDR_ERR_SUCCESS;
472 }
473
474 static enum ndr_err_code ndr_pull_drsuapi_DsBindInfoCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsBindInfoCtr *r)
475 {
476         if (ndr_flags & NDR_SCALARS) {
477                 NDR_CHECK(ndr_pull_align(ndr, 4));
478                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length));
479                 if (r->length < 1 || r->length > 10000) {
480                         return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
481                 }
482                 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->info, r->length));
483                 NDR_CHECK(ndr_pull_drsuapi_DsBindInfo(ndr, NDR_SCALARS, &r->info));
484                 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
485         }
486         if (ndr_flags & NDR_BUFFERS) {
487         }
488         return NDR_ERR_SUCCESS;
489 }
490
491 _PUBLIC_ void ndr_print_drsuapi_DsBindInfoCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsBindInfoCtr *r)
492 {
493         ndr_print_struct(ndr, name, "drsuapi_DsBindInfoCtr");
494         ndr->depth++;
495         ndr_print_uint32(ndr, "length", r->length);
496         ndr_print_set_switch_value(ndr, &r->info, r->length);
497         ndr_print_drsuapi_DsBindInfo(ndr, "info", &r->info);
498         ndr->depth--;
499 }
500
501 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectIdentifier(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectIdentifier *r)
502 {
503         if (ndr_flags & NDR_SCALARS) {
504                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, strlen_m(r->dn) + 1));
505                 NDR_CHECK(ndr_push_align(ndr, 4));
506                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_drsuapi_DsReplicaObjectIdentifier(r, ndr->iconv_convenience, ndr->flags) - 4));
507                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_dom_sid28(&r->sid, ndr->flags)));
508                 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->guid));
509                 NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_SCALARS, &r->sid));
510                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m(r->dn)));
511                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dn, strlen_m(r->dn) + 1, sizeof(uint16_t), CH_UTF16));
512                 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
513         }
514         if (ndr_flags & NDR_BUFFERS) {
515                 NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_BUFFERS, &r->sid));
516         }
517         return NDR_ERR_SUCCESS;
518 }
519
520 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectIdentifier(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectIdentifier *r)
521 {
522         if (ndr_flags & NDR_SCALARS) {
523                 NDR_CHECK(ndr_pull_array_size(ndr, &r->dn));
524                 NDR_CHECK(ndr_pull_align(ndr, 4));
525                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size));
526                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_sid));
527                 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->guid));
528                 NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_SCALARS, &r->sid));
529                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_dn));
530                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dn, ndr_get_array_size(ndr, &r->dn), sizeof(uint16_t), CH_UTF16));
531                 if (r->dn) {
532                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->dn, r->__ndr_size_dn + 1));
533                 }
534                 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
535         }
536         if (ndr_flags & NDR_BUFFERS) {
537                 NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_BUFFERS, &r->sid));
538         }
539         return NDR_ERR_SUCCESS;
540 }
541
542 _PUBLIC_ void ndr_print_drsuapi_DsReplicaObjectIdentifier(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjectIdentifier *r)
543 {
544         ndr_print_struct(ndr, name, "drsuapi_DsReplicaObjectIdentifier");
545         ndr->depth++;
546         ndr_print_uint32(ndr, "__ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_drsuapi_DsReplicaObjectIdentifier(r, ndr->iconv_convenience, ndr->flags) - 4:r->__ndr_size);
547         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);
548         ndr_print_GUID(ndr, "guid", &r->guid);
549         ndr_print_dom_sid28(ndr, "sid", &r->sid);
550         ndr_print_uint32(ndr, "__ndr_size_dn", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m(r->dn):r->__ndr_size_dn);
551         ndr_print_string(ndr, "dn", r->dn);
552         ndr->depth--;
553 }
554
555 _PUBLIC_ size_t ndr_size_drsuapi_DsReplicaObjectIdentifier(const struct drsuapi_DsReplicaObjectIdentifier *r, struct smb_iconv_convenience *ic, int flags)
556 {
557         return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier, ic);
558 }
559
560 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaSyncOptions(struct ndr_push *ndr, int ndr_flags, uint32_t r)
561 {
562         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
563         return NDR_ERR_SUCCESS;
564 }
565
566 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaSyncOptions(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
567 {
568         uint32_t v;
569         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
570         *r = v;
571         return NDR_ERR_SUCCESS;
572 }
573
574 _PUBLIC_ void ndr_print_drsuapi_DsReplicaSyncOptions(struct ndr_print *ndr, const char *name, uint32_t r)
575 {
576         ndr_print_uint32(ndr, name, r);
577         ndr->depth++;
578         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_ASYNCHRONOUS_OPERATION", DRSUAPI_DS_REPLICA_SYNC_ASYNCHRONOUS_OPERATION, r);
579         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_WRITEABLE", DRSUAPI_DS_REPLICA_SYNC_WRITEABLE, r);
580         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_PERIODIC", DRSUAPI_DS_REPLICA_SYNC_PERIODIC, r);
581         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_INTERSITE_MESSAGING", DRSUAPI_DS_REPLICA_SYNC_INTERSITE_MESSAGING, r);
582         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_ALL_SOURCES", DRSUAPI_DS_REPLICA_SYNC_ALL_SOURCES, r);
583         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_FULL", DRSUAPI_DS_REPLICA_SYNC_FULL, r);
584         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_URGENT", DRSUAPI_DS_REPLICA_SYNC_URGENT, r);
585         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_NO_DISCARD", DRSUAPI_DS_REPLICA_SYNC_NO_DISCARD, r);
586         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_FORCE", DRSUAPI_DS_REPLICA_SYNC_FORCE, r);
587         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_ADD_REFERENCE", DRSUAPI_DS_REPLICA_SYNC_ADD_REFERENCE, r);
588         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_NEVER_COMPLETED", DRSUAPI_DS_REPLICA_SYNC_NEVER_COMPLETED, r);
589         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_TWO_WAY", DRSUAPI_DS_REPLICA_SYNC_TWO_WAY, r);
590         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_NEVER_NOTIFY", DRSUAPI_DS_REPLICA_SYNC_NEVER_NOTIFY, r);
591         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_INITIAL", DRSUAPI_DS_REPLICA_SYNC_INITIAL, r);
592         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_USE_COMPRESSION", DRSUAPI_DS_REPLICA_SYNC_USE_COMPRESSION, r);
593         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_ABANDONED", DRSUAPI_DS_REPLICA_SYNC_ABANDONED, r);
594         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_INITIAL_IN_PROGRESS", DRSUAPI_DS_REPLICA_SYNC_INITIAL_IN_PROGRESS, r);
595         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_PARTIAL_ATTRIBUTE_SET", DRSUAPI_DS_REPLICA_SYNC_PARTIAL_ATTRIBUTE_SET, r);
596         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_REQUEUE", DRSUAPI_DS_REPLICA_SYNC_REQUEUE, r);
597         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_NOTIFICATION", DRSUAPI_DS_REPLICA_SYNC_NOTIFICATION, r);
598         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_ASYNCHRONOUS_REPLICA", DRSUAPI_DS_REPLICA_SYNC_ASYNCHRONOUS_REPLICA, r);
599         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_CRITICAL", DRSUAPI_DS_REPLICA_SYNC_CRITICAL, r);
600         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_FULL_IN_PROGRESS", DRSUAPI_DS_REPLICA_SYNC_FULL_IN_PROGRESS, r);
601         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_SYNC_PREEMPTED", DRSUAPI_DS_REPLICA_SYNC_PREEMPTED, r);
602         ndr->depth--;
603 }
604
605 static enum ndr_err_code ndr_push_drsuapi_DsReplicaSyncRequest1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaSyncRequest1 *r)
606 {
607         if (ndr_flags & NDR_SCALARS) {
608                 NDR_CHECK(ndr_push_align(ndr, 5));
609                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->naming_context));
610                 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_guid));
611                 {
612                         uint32_t _flags_save_string = ndr->flags;
613                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
614                         NDR_CHECK(ndr_push_unique_ptr(ndr, r->other_info));
615                         ndr->flags = _flags_save_string;
616                 }
617                 NDR_CHECK(ndr_push_drsuapi_DsReplicaSyncOptions(ndr, NDR_SCALARS, r->options));
618                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
619         }
620         if (ndr_flags & NDR_BUFFERS) {
621                 if (r->naming_context) {
622                         NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
623                 }
624                 {
625                         uint32_t _flags_save_string = ndr->flags;
626                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
627                         if (r->other_info) {
628                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->other_info));
629                         }
630                         ndr->flags = _flags_save_string;
631                 }
632         }
633         return NDR_ERR_SUCCESS;
634 }
635
636 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaSyncRequest1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaSyncRequest1 *r)
637 {
638         uint32_t _ptr_naming_context;
639         TALLOC_CTX *_mem_save_naming_context_0;
640         uint32_t _ptr_other_info;
641         TALLOC_CTX *_mem_save_other_info_0;
642         if (ndr_flags & NDR_SCALARS) {
643                 NDR_CHECK(ndr_pull_align(ndr, 5));
644                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_naming_context));
645                 if (_ptr_naming_context) {
646                         NDR_PULL_ALLOC(ndr, r->naming_context);
647                 } else {
648                         r->naming_context = NULL;
649                 }
650                 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_guid));
651                 {
652                         uint32_t _flags_save_string = ndr->flags;
653                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
654                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_other_info));
655                         if (_ptr_other_info) {
656                                 NDR_PULL_ALLOC(ndr, r->other_info);
657                         } else {
658                                 r->other_info = NULL;
659                         }
660                         ndr->flags = _flags_save_string;
661                 }
662                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaSyncOptions(ndr, NDR_SCALARS, &r->options));
663                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
664         }
665         if (ndr_flags & NDR_BUFFERS) {
666                 if (r->naming_context) {
667                         _mem_save_naming_context_0 = NDR_PULL_GET_MEM_CTX(ndr);
668                         NDR_PULL_SET_MEM_CTX(ndr, r->naming_context, 0);
669                         NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
670                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_naming_context_0, 0);
671                 }
672                 {
673                         uint32_t _flags_save_string = ndr->flags;
674                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
675                         if (r->other_info) {
676                                 _mem_save_other_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
677                                 NDR_PULL_SET_MEM_CTX(ndr, r->other_info, 0);
678                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->other_info));
679                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_other_info_0, 0);
680                         }
681                         ndr->flags = _flags_save_string;
682                 }
683         }
684         return NDR_ERR_SUCCESS;
685 }
686
687 _PUBLIC_ void ndr_print_drsuapi_DsReplicaSyncRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaSyncRequest1 *r)
688 {
689         ndr_print_struct(ndr, name, "drsuapi_DsReplicaSyncRequest1");
690         ndr->depth++;
691         ndr_print_ptr(ndr, "naming_context", r->naming_context);
692         ndr->depth++;
693         if (r->naming_context) {
694                 ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "naming_context", r->naming_context);
695         }
696         ndr->depth--;
697         ndr_print_GUID(ndr, "source_dsa_guid", &r->source_dsa_guid);
698         ndr_print_ptr(ndr, "other_info", r->other_info);
699         ndr->depth++;
700         if (r->other_info) {
701                 ndr_print_string(ndr, "other_info", r->other_info);
702         }
703         ndr->depth--;
704         ndr_print_drsuapi_DsReplicaSyncOptions(ndr, "options", r->options);
705         ndr->depth--;
706 }
707
708 static enum ndr_err_code ndr_push_drsuapi_DsReplicaSyncRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsReplicaSyncRequest *r)
709 {
710         if (ndr_flags & NDR_SCALARS) {
711                 int level = ndr_push_get_switch_value(ndr, r);
712                 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
713                 NDR_CHECK(ndr_push_union_align(ndr, 5));
714                 switch (level) {
715                         case 1: {
716                                 NDR_CHECK(ndr_push_drsuapi_DsReplicaSyncRequest1(ndr, NDR_SCALARS, &r->req1));
717                         break; }
718
719                         default:
720                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
721                 }
722         }
723         if (ndr_flags & NDR_BUFFERS) {
724                 int level = ndr_push_get_switch_value(ndr, r);
725                 switch (level) {
726                         case 1:
727                                 NDR_CHECK(ndr_push_drsuapi_DsReplicaSyncRequest1(ndr, NDR_BUFFERS, &r->req1));
728                         break;
729
730                         default:
731                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
732                 }
733         }
734         return NDR_ERR_SUCCESS;
735 }
736
737 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaSyncRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsReplicaSyncRequest *r)
738 {
739         int level;
740         int32_t _level;
741         level = ndr_pull_get_switch_value(ndr, r);
742         if (ndr_flags & NDR_SCALARS) {
743                 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
744                 if (_level != level) {
745                         return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
746                 }
747                 NDR_CHECK(ndr_pull_union_align(ndr, 5));
748                 switch (level) {
749                         case 1: {
750                                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaSyncRequest1(ndr, NDR_SCALARS, &r->req1));
751                         break; }
752
753                         default:
754                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
755                 }
756         }
757         if (ndr_flags & NDR_BUFFERS) {
758                 switch (level) {
759                         case 1:
760                                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaSyncRequest1(ndr, NDR_BUFFERS, &r->req1));
761                         break;
762
763                         default:
764                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
765                 }
766         }
767         return NDR_ERR_SUCCESS;
768 }
769
770 _PUBLIC_ void ndr_print_drsuapi_DsReplicaSyncRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsReplicaSyncRequest *r)
771 {
772         int level;
773         level = ndr_print_get_switch_value(ndr, r);
774         ndr_print_union(ndr, name, level, "drsuapi_DsReplicaSyncRequest");
775         switch (level) {
776                 case 1:
777                         ndr_print_drsuapi_DsReplicaSyncRequest1(ndr, "req1", &r->req1);
778                 break;
779
780                 default:
781                         ndr_print_bad_level(ndr, name, level);
782         }
783 }
784
785 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaHighWaterMark(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaHighWaterMark *r)
786 {
787         if (ndr_flags & NDR_SCALARS) {
788                 NDR_CHECK(ndr_push_align(ndr, 8));
789                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->tmp_highest_usn));
790                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->reserved_usn));
791                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->highest_usn));
792                 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
793         }
794         if (ndr_flags & NDR_BUFFERS) {
795         }
796         return NDR_ERR_SUCCESS;
797 }
798
799 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaHighWaterMark(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaHighWaterMark *r)
800 {
801         if (ndr_flags & NDR_SCALARS) {
802                 NDR_CHECK(ndr_pull_align(ndr, 8));
803                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->tmp_highest_usn));
804                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->reserved_usn));
805                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->highest_usn));
806                 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
807         }
808         if (ndr_flags & NDR_BUFFERS) {
809         }
810         return NDR_ERR_SUCCESS;
811 }
812
813 _PUBLIC_ void ndr_print_drsuapi_DsReplicaHighWaterMark(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaHighWaterMark *r)
814 {
815         ndr_print_struct(ndr, name, "drsuapi_DsReplicaHighWaterMark");
816         ndr->depth++;
817         ndr_print_hyper(ndr, "tmp_highest_usn", r->tmp_highest_usn);
818         ndr_print_hyper(ndr, "reserved_usn", r->reserved_usn);
819         ndr_print_hyper(ndr, "highest_usn", r->highest_usn);
820         ndr->depth--;
821 }
822
823 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaCursor(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursor *r)
824 {
825         if (ndr_flags & NDR_SCALARS) {
826                 NDR_CHECK(ndr_push_align(ndr, 8));
827                 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
828                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->highest_usn));
829                 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
830         }
831         if (ndr_flags & NDR_BUFFERS) {
832         }
833         return NDR_ERR_SUCCESS;
834 }
835
836 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursor(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursor *r)
837 {
838         if (ndr_flags & NDR_SCALARS) {
839                 NDR_CHECK(ndr_pull_align(ndr, 8));
840                 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
841                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->highest_usn));
842                 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
843         }
844         if (ndr_flags & NDR_BUFFERS) {
845         }
846         return NDR_ERR_SUCCESS;
847 }
848
849 _PUBLIC_ void ndr_print_drsuapi_DsReplicaCursor(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursor *r)
850 {
851         ndr_print_struct(ndr, name, "drsuapi_DsReplicaCursor");
852         ndr->depth++;
853         ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id);
854         ndr_print_hyper(ndr, "highest_usn", r->highest_usn);
855         ndr->depth--;
856 }
857
858 static enum ndr_err_code ndr_push_drsuapi_DsReplicaCursorCtrEx(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursorCtrEx *r)
859 {
860         uint32_t cntr_cursors_0;
861         if (ndr_flags & NDR_SCALARS) {
862                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
863                 NDR_CHECK(ndr_push_align(ndr, 8));
864                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 1));
865                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
866                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
867                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
868                 for (cntr_cursors_0 = 0; cntr_cursors_0 < r->count; cntr_cursors_0++) {
869                         NDR_CHECK(ndr_push_drsuapi_DsReplicaCursor(ndr, NDR_SCALARS, &r->cursors[cntr_cursors_0]));
870                 }
871                 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
872         }
873         if (ndr_flags & NDR_BUFFERS) {
874         }
875         return NDR_ERR_SUCCESS;
876 }
877
878 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursorCtrEx(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursorCtrEx *r)
879 {
880         uint32_t cntr_cursors_0;
881         TALLOC_CTX *_mem_save_cursors_0;
882         if (ndr_flags & NDR_SCALARS) {
883                 NDR_CHECK(ndr_pull_array_size(ndr, &r->cursors));
884                 NDR_CHECK(ndr_pull_align(ndr, 8));
885                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
886                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved1));
887                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
888                 if (r->count > 0x100000) {
889                         return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
890                 }
891                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved2));
892                 NDR_PULL_ALLOC_N(ndr, r->cursors, ndr_get_array_size(ndr, &r->cursors));
893                 _mem_save_cursors_0 = NDR_PULL_GET_MEM_CTX(ndr);
894                 NDR_PULL_SET_MEM_CTX(ndr, r->cursors, 0);
895                 for (cntr_cursors_0 = 0; cntr_cursors_0 < r->count; cntr_cursors_0++) {
896                         NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursor(ndr, NDR_SCALARS, &r->cursors[cntr_cursors_0]));
897                 }
898                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_cursors_0, 0);
899                 if (r->cursors) {
900                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->cursors, r->count));
901                 }
902                 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
903         }
904         if (ndr_flags & NDR_BUFFERS) {
905         }
906         return NDR_ERR_SUCCESS;
907 }
908
909 _PUBLIC_ void ndr_print_drsuapi_DsReplicaCursorCtrEx(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursorCtrEx *r)
910 {
911         uint32_t cntr_cursors_0;
912         ndr_print_struct(ndr, name, "drsuapi_DsReplicaCursorCtrEx");
913         ndr->depth++;
914         ndr_print_uint32(ndr, "version", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?1:r->version);
915         ndr_print_uint32(ndr, "reserved1", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved1);
916         ndr_print_uint32(ndr, "count", r->count);
917         ndr_print_uint32(ndr, "reserved2", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved2);
918         ndr->print(ndr, "%s: ARRAY(%d)", "cursors", (int)r->count);
919         ndr->depth++;
920         for (cntr_cursors_0=0;cntr_cursors_0<r->count;cntr_cursors_0++) {
921                 char *idx_0=NULL;
922                 if (asprintf(&idx_0, "[%d]", cntr_cursors_0) != -1) {
923                         ndr_print_drsuapi_DsReplicaCursor(ndr, "cursors", &r->cursors[cntr_cursors_0]);
924                         free(idx_0);
925                 }
926         }
927         ndr->depth--;
928         ndr->depth--;
929 }
930
931 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaNeighbourFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
932 {
933         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
934         return NDR_ERR_SUCCESS;
935 }
936
937 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaNeighbourFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
938 {
939         uint32_t v;
940         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
941         *r = v;
942         return NDR_ERR_SUCCESS;
943 }
944
945 _PUBLIC_ void ndr_print_drsuapi_DsReplicaNeighbourFlags(struct ndr_print *ndr, const char *name, uint32_t r)
946 {
947         ndr_print_uint32(ndr, name, r);
948         ndr->depth++;
949         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_WRITEABLE", DRSUAPI_DS_REPLICA_NEIGHBOUR_WRITEABLE, r);
950         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_SYNC_ON_STARTUP", DRSUAPI_DS_REPLICA_NEIGHBOUR_SYNC_ON_STARTUP, r);
951         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_DO_SCHEDULED_SYNCS", DRSUAPI_DS_REPLICA_NEIGHBOUR_DO_SCHEDULED_SYNCS, r);
952         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);
953         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_ASYNC_REP", DRSUAPI_DS_REPLICA_NEIGHBOUR_ASYNC_REP, r);
954         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_IGNORE_ERROR", DRSUAPI_DS_REPLICA_NEIGHBOUR_IGNORE_ERROR, r);
955         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_TWO_WAY_SYNC", DRSUAPI_DS_REPLICA_NEIGHBOUR_TWO_WAY_SYNC, r);
956         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_CRITICAL_ONLY", DRSUAPI_DS_REPLICA_NEIGHBOUR_CRITICAL_ONLY, r);
957         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_RETURN_OBJECT_PARENTS", DRSUAPI_DS_REPLICA_NEIGHBOUR_RETURN_OBJECT_PARENTS, r);
958         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_FULL_IN_PROGRESS", DRSUAPI_DS_REPLICA_NEIGHBOUR_FULL_IN_PROGRESS, r);
959         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_FULL_SYNC_PACKET", DRSUAPI_DS_REPLICA_NEIGHBOUR_FULL_SYNC_PACKET, r);
960         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_NEVER_SYNCED", DRSUAPI_DS_REPLICA_NEIGHBOUR_NEVER_SYNCED, r);
961         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_SPECIAL_SECRET_PROCESSING", DRSUAPI_DS_REPLICA_NEIGHBOUR_SPECIAL_SECRET_PROCESSING, r);
962         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_PREEMPTED", DRSUAPI_DS_REPLICA_NEIGHBOUR_PREEMPTED, r);
963         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_IGNORE_CHANGE_NOTIFICATIONS", DRSUAPI_DS_REPLICA_NEIGHBOUR_IGNORE_CHANGE_NOTIFICATIONS, r);
964         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_DISABLE_SCHEDULED_SYNC", DRSUAPI_DS_REPLICA_NEIGHBOUR_DISABLE_SCHEDULED_SYNC, r);
965         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_COMPRESS_CHANGES", DRSUAPI_DS_REPLICA_NEIGHBOUR_COMPRESS_CHANGES, r);
966         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_NO_CHANGE_NOTIFICATIONS", DRSUAPI_DS_REPLICA_NEIGHBOUR_NO_CHANGE_NOTIFICATIONS, r);
967         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_NEIGHBOUR_PARTIAL_ATTRIBUTE_SET", DRSUAPI_DS_REPLICA_NEIGHBOUR_PARTIAL_ATTRIBUTE_SET, r);
968         ndr->depth--;
969 }
970
971 static enum ndr_err_code ndr_push_drsuapi_DsExtendedOperation(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsExtendedOperation r)
972 {
973         {
974                 uint32_t _flags_save_ENUM = ndr->flags;
975                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
976                 NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
977                 ndr->flags = _flags_save_ENUM;
978         }
979         return NDR_ERR_SUCCESS;
980 }
981
982 static enum ndr_err_code ndr_pull_drsuapi_DsExtendedOperation(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsExtendedOperation *r)
983 {
984         uint32_t v;
985         {
986                 uint32_t _flags_save_ENUM = ndr->flags;
987                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
988                 NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
989                 *r = v;
990                 ndr->flags = _flags_save_ENUM;
991         }
992         return NDR_ERR_SUCCESS;
993 }
994
995 _PUBLIC_ void ndr_print_drsuapi_DsExtendedOperation(struct ndr_print *ndr, const char *name, enum drsuapi_DsExtendedOperation r)
996 {
997         const char *val = NULL;
998
999         {
1000                 uint32_t _flags_save_ENUM = ndr->flags;
1001                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1002                 switch (r) {
1003                         case DRSUAPI_EXOP_NONE: val = "DRSUAPI_EXOP_NONE"; break;
1004                         case DRSUAPI_EXOP_FSMO_REQ_ROLE: val = "DRSUAPI_EXOP_FSMO_REQ_ROLE"; break;
1005                         case DRSUAPI_EXOP_FSMO_RID_ALLOC: val = "DRSUAPI_EXOP_FSMO_RID_ALLOC"; break;
1006                         case DRSUAPI_EXOP_FSMO_RID_REQ_ROLE: val = "DRSUAPI_EXOP_FSMO_RID_REQ_ROLE"; break;
1007                         case DRSUAPI_EXOP_FSMO_REQ_PDC: val = "DRSUAPI_EXOP_FSMO_REQ_PDC"; break;
1008                         case DRSUAPI_EXOP_FSMO_ABANDON_ROLE: val = "DRSUAPI_EXOP_FSMO_ABANDON_ROLE"; break;
1009                         case DRSUAPI_EXOP_REPL_OBJ: val = "DRSUAPI_EXOP_REPL_OBJ"; break;
1010                         case DRSUAPI_EXOP_REPL_SECRET: val = "DRSUAPI_EXOP_REPL_SECRET"; break;
1011                 }
1012                 ndr_print_enum(ndr, name, "ENUM", val, r);
1013                 ndr->flags = _flags_save_ENUM;
1014         }
1015 }
1016
1017 static enum ndr_err_code ndr_push_drsuapi_DsExtendedError(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsExtendedError r)
1018 {
1019         {
1020                 uint32_t _flags_save_ENUM = ndr->flags;
1021                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1022                 NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
1023                 ndr->flags = _flags_save_ENUM;
1024         }
1025         return NDR_ERR_SUCCESS;
1026 }
1027
1028 static enum ndr_err_code ndr_pull_drsuapi_DsExtendedError(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsExtendedError *r)
1029 {
1030         uint32_t v;
1031         {
1032                 uint32_t _flags_save_ENUM = ndr->flags;
1033                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1034                 NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
1035                 *r = v;
1036                 ndr->flags = _flags_save_ENUM;
1037         }
1038         return NDR_ERR_SUCCESS;
1039 }
1040
1041 _PUBLIC_ void ndr_print_drsuapi_DsExtendedError(struct ndr_print *ndr, const char *name, enum drsuapi_DsExtendedError r)
1042 {
1043         const char *val = NULL;
1044
1045         {
1046                 uint32_t _flags_save_ENUM = ndr->flags;
1047                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1048                 switch (r) {
1049                         case DRSUAPI_EXOP_ERR_NONE: val = "DRSUAPI_EXOP_ERR_NONE"; break;
1050                         case DRSUAPI_EXOP_ERR_SUCCESS: val = "DRSUAPI_EXOP_ERR_SUCCESS"; break;
1051                         case DRSUAPI_EXOP_ERR_UNKNOWN_OP: val = "DRSUAPI_EXOP_ERR_UNKNOWN_OP"; break;
1052                         case DRSUAPI_EXOP_ERR_FSMO_NOT_OWNER: val = "DRSUAPI_EXOP_ERR_FSMO_NOT_OWNER"; break;
1053                         case DRSUAPI_EXOP_ERR_UPDATE_ERR: val = "DRSUAPI_EXOP_ERR_UPDATE_ERR"; break;
1054                         case DRSUAPI_EXOP_ERR_EXCEPTION: val = "DRSUAPI_EXOP_ERR_EXCEPTION"; break;
1055                         case DRSUAPI_EXOP_ERR_UNKNOWN_CALLER: val = "DRSUAPI_EXOP_ERR_UNKNOWN_CALLER"; break;
1056                         case DRSUAPI_EXOP_ERR_RID_ALLOC: val = "DRSUAPI_EXOP_ERR_RID_ALLOC"; break;
1057                         case DRSUAPI_EXOP_ERR_FSMO_OWNER_DELETED: val = "DRSUAPI_EXOP_ERR_FSMO_OWNER_DELETED"; break;
1058                         case DRSUAPI_EXOP_ERR_FMSO_PENDING_OP: val = "DRSUAPI_EXOP_ERR_FMSO_PENDING_OP"; break;
1059                         case DRSUAPI_EXOP_ERR_MISMATCH: val = "DRSUAPI_EXOP_ERR_MISMATCH"; break;
1060                         case DRSUAPI_EXOP_ERR_COULDNT_CONTACT: val = "DRSUAPI_EXOP_ERR_COULDNT_CONTACT"; break;
1061                         case DRSUAPI_EXOP_ERR_FSMO_REFUSING_ROLES: val = "DRSUAPI_EXOP_ERR_FSMO_REFUSING_ROLES"; break;
1062                         case DRSUAPI_EXOP_ERR_DIR_ERROR: val = "DRSUAPI_EXOP_ERR_DIR_ERROR"; break;
1063                         case DRSUAPI_EXOP_ERR_FSMO_MISSING_SETTINGS: val = "DRSUAPI_EXOP_ERR_FSMO_MISSING_SETTINGS"; break;
1064                         case DRSUAPI_EXOP_ERR_ACCESS_DENIED: val = "DRSUAPI_EXOP_ERR_ACCESS_DENIED"; break;
1065                         case DRSUAPI_EXOP_ERR_PARAM_ERROR: val = "DRSUAPI_EXOP_ERR_PARAM_ERROR"; break;
1066                 }
1067                 ndr_print_enum(ndr, name, "ENUM", val, r);
1068                 ndr->flags = _flags_save_ENUM;
1069         }
1070 }
1071
1072 static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesRequest5(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesRequest5 *r)
1073 {
1074         if (ndr_flags & NDR_SCALARS) {
1075                 NDR_CHECK(ndr_push_align(ndr, 8));
1076                 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->destination_dsa_guid));
1077                 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
1078                 if (r->naming_context == NULL) {
1079                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1080                 }
1081                 NDR_CHECK(ndr_push_ref_ptr(ndr));
1082                 NDR_CHECK(ndr_push_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->highwatermark));
1083                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->uptodateness_vector));
1084                 NDR_CHECK(ndr_push_drsuapi_DsReplicaNeighbourFlags(ndr, NDR_SCALARS, r->replica_flags));
1085                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_object_count));
1086                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_ndr_size));
1087                 NDR_CHECK(ndr_push_drsuapi_DsExtendedOperation(ndr, NDR_SCALARS, r->extended_op));
1088                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->fsmo_info));
1089                 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
1090         }
1091         if (ndr_flags & NDR_BUFFERS) {
1092                 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
1093                 if (r->uptodateness_vector) {
1094                         NDR_CHECK(ndr_push_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->uptodateness_vector));
1095                 }
1096         }
1097         return NDR_ERR_SUCCESS;
1098 }
1099
1100 static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesRequest5(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesRequest5 *r)
1101 {
1102         uint32_t _ptr_naming_context;
1103         TALLOC_CTX *_mem_save_naming_context_0;
1104         uint32_t _ptr_uptodateness_vector;
1105         TALLOC_CTX *_mem_save_uptodateness_vector_0;
1106         if (ndr_flags & NDR_SCALARS) {
1107                 NDR_CHECK(ndr_pull_align(ndr, 8));
1108                 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->destination_dsa_guid));
1109                 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
1110                 NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_naming_context));
1111                 if (_ptr_naming_context) {
1112                         NDR_PULL_ALLOC(ndr, r->naming_context);
1113                 } else {
1114                         r->naming_context = NULL;
1115                 }
1116                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->highwatermark));
1117                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_uptodateness_vector));
1118                 if (_ptr_uptodateness_vector) {
1119                         NDR_PULL_ALLOC(ndr, r->uptodateness_vector);
1120                 } else {
1121                         r->uptodateness_vector = NULL;
1122                 }
1123                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaNeighbourFlags(ndr, NDR_SCALARS, &r->replica_flags));
1124                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_object_count));
1125                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_ndr_size));
1126                 NDR_CHECK(ndr_pull_drsuapi_DsExtendedOperation(ndr, NDR_SCALARS, &r->extended_op));
1127                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->fsmo_info));
1128                 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
1129         }
1130         if (ndr_flags & NDR_BUFFERS) {
1131                 _mem_save_naming_context_0 = NDR_PULL_GET_MEM_CTX(ndr);
1132                 NDR_PULL_SET_MEM_CTX(ndr, r->naming_context, 0);
1133                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
1134                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_naming_context_0, 0);
1135                 if (r->uptodateness_vector) {
1136                         _mem_save_uptodateness_vector_0 = NDR_PULL_GET_MEM_CTX(ndr);
1137                         NDR_PULL_SET_MEM_CTX(ndr, r->uptodateness_vector, 0);
1138                         NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->uptodateness_vector));
1139                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_uptodateness_vector_0, 0);
1140                 }
1141         }
1142         return NDR_ERR_SUCCESS;
1143 }
1144
1145 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesRequest5(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesRequest5 *r)
1146 {
1147         ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesRequest5");
1148         ndr->depth++;
1149         ndr_print_GUID(ndr, "destination_dsa_guid", &r->destination_dsa_guid);
1150         ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id);
1151         ndr_print_ptr(ndr, "naming_context", r->naming_context);
1152         ndr->depth++;
1153         ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "naming_context", r->naming_context);
1154         ndr->depth--;
1155         ndr_print_drsuapi_DsReplicaHighWaterMark(ndr, "highwatermark", &r->highwatermark);
1156         ndr_print_ptr(ndr, "uptodateness_vector", r->uptodateness_vector);
1157         ndr->depth++;
1158         if (r->uptodateness_vector) {
1159                 ndr_print_drsuapi_DsReplicaCursorCtrEx(ndr, "uptodateness_vector", r->uptodateness_vector);
1160         }
1161         ndr->depth--;
1162         ndr_print_drsuapi_DsReplicaNeighbourFlags(ndr, "replica_flags", r->replica_flags);
1163         ndr_print_uint32(ndr, "max_object_count", r->max_object_count);
1164         ndr_print_uint32(ndr, "max_ndr_size", r->max_ndr_size);
1165         ndr_print_drsuapi_DsExtendedOperation(ndr, "extended_op", r->extended_op);
1166         ndr_print_hyper(ndr, "fsmo_info", r->fsmo_info);
1167         ndr->depth--;
1168 }
1169
1170 static enum ndr_err_code ndr_push_drsuapi_DsReplicaOID(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaOID *r)
1171 {
1172         if (ndr_flags & NDR_SCALARS) {
1173                 NDR_CHECK(ndr_push_align(ndr, 5));
1174                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length));
1175                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->binary_oid));
1176                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
1177         }
1178         if (ndr_flags & NDR_BUFFERS) {
1179                 if (r->binary_oid) {
1180                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->length));
1181                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->binary_oid, r->length));
1182                 }
1183         }
1184         return NDR_ERR_SUCCESS;
1185 }
1186
1187 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaOID(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaOID *r)
1188 {
1189         uint32_t _ptr_binary_oid;
1190         TALLOC_CTX *_mem_save_binary_oid_0;
1191         if (ndr_flags & NDR_SCALARS) {
1192                 NDR_CHECK(ndr_pull_align(ndr, 5));
1193                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length));
1194                 if (r->length > 10000) {
1195                         return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
1196                 }
1197                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_binary_oid));
1198                 if (_ptr_binary_oid) {
1199                         NDR_PULL_ALLOC(ndr, r->binary_oid);
1200                 } else {
1201                         r->binary_oid = NULL;
1202                 }
1203                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
1204         }
1205         if (ndr_flags & NDR_BUFFERS) {
1206                 if (r->binary_oid) {
1207                         _mem_save_binary_oid_0 = NDR_PULL_GET_MEM_CTX(ndr);
1208                         NDR_PULL_SET_MEM_CTX(ndr, r->binary_oid, 0);
1209                         NDR_CHECK(ndr_pull_array_size(ndr, &r->binary_oid));
1210                         NDR_PULL_ALLOC_N(ndr, r->binary_oid, ndr_get_array_size(ndr, &r->binary_oid));
1211                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->binary_oid, ndr_get_array_size(ndr, &r->binary_oid)));
1212                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_binary_oid_0, 0);
1213                 }
1214                 if (r->binary_oid) {
1215                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->binary_oid, r->length));
1216                 }
1217         }
1218         return NDR_ERR_SUCCESS;
1219 }
1220
1221 static enum ndr_err_code ndr_push_drsuapi_DsReplicaOIDMapping(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaOIDMapping *r)
1222 {
1223         if (ndr_flags & NDR_SCALARS) {
1224                 NDR_CHECK(ndr_push_align(ndr, 5));
1225                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->id_prefix));
1226                 NDR_CHECK(ndr_push_drsuapi_DsReplicaOID(ndr, NDR_SCALARS, &r->oid));
1227                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
1228         }
1229         if (ndr_flags & NDR_BUFFERS) {
1230                 NDR_CHECK(ndr_push_drsuapi_DsReplicaOID(ndr, NDR_BUFFERS, &r->oid));
1231         }
1232         return NDR_ERR_SUCCESS;
1233 }
1234
1235 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaOIDMapping(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaOIDMapping *r)
1236 {
1237         if (ndr_flags & NDR_SCALARS) {
1238                 NDR_CHECK(ndr_pull_align(ndr, 5));
1239                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->id_prefix));
1240                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOID(ndr, NDR_SCALARS, &r->oid));
1241                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
1242         }
1243         if (ndr_flags & NDR_BUFFERS) {
1244                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOID(ndr, NDR_BUFFERS, &r->oid));
1245         }
1246         return NDR_ERR_SUCCESS;
1247 }
1248
1249 _PUBLIC_ void ndr_print_drsuapi_DsReplicaOIDMapping(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaOIDMapping *r)
1250 {
1251         ndr_print_struct(ndr, name, "drsuapi_DsReplicaOIDMapping");
1252         ndr->depth++;
1253         ndr_print_uint32(ndr, "id_prefix", r->id_prefix);
1254         ndr_print_drsuapi_DsReplicaOID(ndr, "oid", &r->oid);
1255         ndr->depth--;
1256 }
1257
1258 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaOIDMapping_Ctr *r)
1259 {
1260         uint32_t cntr_mappings_1;
1261         if (ndr_flags & NDR_SCALARS) {
1262                 NDR_CHECK(ndr_push_align(ndr, 5));
1263                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_mappings));
1264                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->mappings));
1265                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
1266         }
1267         if (ndr_flags & NDR_BUFFERS) {
1268                 if (r->mappings) {
1269                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->num_mappings));
1270                         for (cntr_mappings_1 = 0; cntr_mappings_1 < r->num_mappings; cntr_mappings_1++) {
1271                                 NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping(ndr, NDR_SCALARS, &r->mappings[cntr_mappings_1]));
1272                         }
1273                         for (cntr_mappings_1 = 0; cntr_mappings_1 < r->num_mappings; cntr_mappings_1++) {
1274                                 NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping(ndr, NDR_BUFFERS, &r->mappings[cntr_mappings_1]));
1275                         }
1276                 }
1277         }
1278         return NDR_ERR_SUCCESS;
1279 }
1280
1281 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaOIDMapping_Ctr *r)
1282 {
1283         uint32_t _ptr_mappings;
1284         uint32_t cntr_mappings_1;
1285         TALLOC_CTX *_mem_save_mappings_0;
1286         TALLOC_CTX *_mem_save_mappings_1;
1287         if (ndr_flags & NDR_SCALARS) {
1288                 NDR_CHECK(ndr_pull_align(ndr, 5));
1289                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_mappings));
1290                 if (r->num_mappings > 0x100000) {
1291                         return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
1292                 }
1293                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_mappings));
1294                 if (_ptr_mappings) {
1295                         NDR_PULL_ALLOC(ndr, r->mappings);
1296                 } else {
1297                         r->mappings = NULL;
1298                 }
1299                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
1300         }
1301         if (ndr_flags & NDR_BUFFERS) {
1302                 if (r->mappings) {
1303                         _mem_save_mappings_0 = NDR_PULL_GET_MEM_CTX(ndr);
1304                         NDR_PULL_SET_MEM_CTX(ndr, r->mappings, 0);
1305                         NDR_CHECK(ndr_pull_array_size(ndr, &r->mappings));
1306                         NDR_PULL_ALLOC_N(ndr, r->mappings, ndr_get_array_size(ndr, &r->mappings));
1307                         _mem_save_mappings_1 = NDR_PULL_GET_MEM_CTX(ndr);
1308                         NDR_PULL_SET_MEM_CTX(ndr, r->mappings, 0);
1309                         for (cntr_mappings_1 = 0; cntr_mappings_1 < r->num_mappings; cntr_mappings_1++) {
1310                                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping(ndr, NDR_SCALARS, &r->mappings[cntr_mappings_1]));
1311                         }
1312                         for (cntr_mappings_1 = 0; cntr_mappings_1 < r->num_mappings; cntr_mappings_1++) {
1313                                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping(ndr, NDR_BUFFERS, &r->mappings[cntr_mappings_1]));
1314                         }
1315                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_mappings_1, 0);
1316                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_mappings_0, 0);
1317                 }
1318                 if (r->mappings) {
1319                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->mappings, r->num_mappings));
1320                 }
1321         }
1322         return NDR_ERR_SUCCESS;
1323 }
1324
1325 _PUBLIC_ void ndr_print_drsuapi_DsReplicaOIDMapping_Ctr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaOIDMapping_Ctr *r)
1326 {
1327         uint32_t cntr_mappings_1;
1328         ndr_print_struct(ndr, name, "drsuapi_DsReplicaOIDMapping_Ctr");
1329         ndr->depth++;
1330         ndr_print_uint32(ndr, "num_mappings", r->num_mappings);
1331         ndr_print_ptr(ndr, "mappings", r->mappings);
1332         ndr->depth++;
1333         if (r->mappings) {
1334                 ndr->print(ndr, "%s: ARRAY(%d)", "mappings", (int)r->num_mappings);
1335                 ndr->depth++;
1336                 for (cntr_mappings_1=0;cntr_mappings_1<r->num_mappings;cntr_mappings_1++) {
1337                         char *idx_1=NULL;
1338                         if (asprintf(&idx_1, "[%d]", cntr_mappings_1) != -1) {
1339                                 ndr_print_drsuapi_DsReplicaOIDMapping(ndr, "mappings", &r->mappings[cntr_mappings_1]);
1340                                 free(idx_1);
1341                         }
1342                 }
1343                 ndr->depth--;
1344         }
1345         ndr->depth--;
1346         ndr->depth--;
1347 }
1348
1349 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsAttributeId(struct ndr_push *ndr, int ndr_flags, enum drsuapi_DsAttributeId r)
1350 {
1351         {
1352                 uint32_t _flags_save_ENUM = ndr->flags;
1353                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1354                 NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
1355                 ndr->flags = _flags_save_ENUM;
1356         }
1357         return NDR_ERR_SUCCESS;
1358 }
1359
1360 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsAttributeId(struct ndr_pull *ndr, int ndr_flags, enum drsuapi_DsAttributeId *r)
1361 {
1362         uint32_t v;
1363         {
1364                 uint32_t _flags_save_ENUM = ndr->flags;
1365                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1366                 NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
1367                 *r = v;
1368                 ndr->flags = _flags_save_ENUM;
1369         }
1370         return NDR_ERR_SUCCESS;
1371 }
1372
1373 _PUBLIC_ void ndr_print_drsuapi_DsAttributeId(struct ndr_print *ndr, const char *name, enum drsuapi_DsAttributeId r)
1374 {
1375         const char *val = NULL;
1376
1377         {
1378                 uint32_t _flags_save_ENUM = ndr->flags;
1379                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1380                 switch (r) {
1381                         case DRSUAPI_ATTRIBUTE_objectClass: val = "DRSUAPI_ATTRIBUTE_objectClass"; break;
1382                         case DRSUAPI_ATTRIBUTE_cn: val = "DRSUAPI_ATTRIBUTE_cn"; break;
1383                         case DRSUAPI_ATTRIBUTE_description: val = "DRSUAPI_ATTRIBUTE_description"; break;
1384                         case DRSUAPI_ATTRIBUTE_member: val = "DRSUAPI_ATTRIBUTE_member"; break;
1385                         case DRSUAPI_ATTRIBUTE_instanceType: val = "DRSUAPI_ATTRIBUTE_instanceType"; break;
1386                         case DRSUAPI_ATTRIBUTE_whenCreated: val = "DRSUAPI_ATTRIBUTE_whenCreated"; break;
1387                         case DRSUAPI_ATTRIBUTE_possSuperiors: val = "DRSUAPI_ATTRIBUTE_possSuperiors"; break;
1388                         case DRSUAPI_ATTRIBUTE_hasMasterNCs: val = "DRSUAPI_ATTRIBUTE_hasMasterNCs"; break;
1389                         case DRSUAPI_ATTRIBUTE_subClassOf: val = "DRSUAPI_ATTRIBUTE_subClassOf"; break;
1390                         case DRSUAPI_ATTRIBUTE_governsID: val = "DRSUAPI_ATTRIBUTE_governsID"; break;
1391                         case DRSUAPI_ATTRIBUTE_mustContain: val = "DRSUAPI_ATTRIBUTE_mustContain"; break;
1392                         case DRSUAPI_ATTRIBUTE_mayContain: val = "DRSUAPI_ATTRIBUTE_mayContain"; break;
1393                         case DRSUAPI_ATTRIBUTE_rDNAttId: val = "DRSUAPI_ATTRIBUTE_rDNAttId"; break;
1394                         case DRSUAPI_ATTRIBUTE_attributeID: val = "DRSUAPI_ATTRIBUTE_attributeID"; break;
1395                         case DRSUAPI_ATTRIBUTE_attributeSyntax: val = "DRSUAPI_ATTRIBUTE_attributeSyntax"; break;
1396                         case DRSUAPI_ATTRIBUTE_isSingleValued: val = "DRSUAPI_ATTRIBUTE_isSingleValued"; break;
1397                         case DRSUAPI_ATTRIBUTE_rangeLower: val = "DRSUAPI_ATTRIBUTE_rangeLower"; break;
1398                         case DRSUAPI_ATTRIBUTE_rangeUpper: val = "DRSUAPI_ATTRIBUTE_rangeUpper"; break;
1399                         case DRSUAPI_ATTRIBUTE_dMDLocation: val = "DRSUAPI_ATTRIBUTE_dMDLocation"; break;
1400                         case DRSUAPI_ATTRIBUTE_objectVersion: val = "DRSUAPI_ATTRIBUTE_objectVersion"; break;
1401                         case DRSUAPI_ATTRIBUTE_invocationId: val = "DRSUAPI_ATTRIBUTE_invocationId"; break;
1402                         case DRSUAPI_ATTRIBUTE_showInAdvancedViewOnly: val = "DRSUAPI_ATTRIBUTE_showInAdvancedViewOnly"; break;
1403                         case DRSUAPI_ATTRIBUTE_adminDisplayName: val = "DRSUAPI_ATTRIBUTE_adminDisplayName"; break;
1404                         case DRSUAPI_ATTRIBUTE_adminDescription: val = "DRSUAPI_ATTRIBUTE_adminDescription"; break;
1405                         case DRSUAPI_ATTRIBUTE_oMSyntax: val = "DRSUAPI_ATTRIBUTE_oMSyntax"; break;
1406                         case DRSUAPI_ATTRIBUTE_ntSecurityDescriptor: val = "DRSUAPI_ATTRIBUTE_ntSecurityDescriptor"; break;
1407                         case DRSUAPI_ATTRIBUTE_searchFlags: val = "DRSUAPI_ATTRIBUTE_searchFlags"; break;
1408                         case DRSUAPI_ATTRIBUTE_auxiliaryClass: val = "DRSUAPI_ATTRIBUTE_auxiliaryClass"; break;
1409                         case DRSUAPI_ATTRIBUTE_lDAPDisplayName: val = "DRSUAPI_ATTRIBUTE_lDAPDisplayName"; break;
1410                         case DRSUAPI_ATTRIBUTE_name: val = "DRSUAPI_ATTRIBUTE_name"; break;
1411                         case DRSUAPI_ATTRIBUTE_userAccountControl: val = "DRSUAPI_ATTRIBUTE_userAccountControl"; break;
1412                         case DRSUAPI_ATTRIBUTE_currentValue: val = "DRSUAPI_ATTRIBUTE_currentValue"; break;
1413                         case DRSUAPI_ATTRIBUTE_homeDirectory: val = "DRSUAPI_ATTRIBUTE_homeDirectory"; break;
1414                         case DRSUAPI_ATTRIBUTE_homeDrive: val = "DRSUAPI_ATTRIBUTE_homeDrive"; break;
1415                         case DRSUAPI_ATTRIBUTE_scriptPath: val = "DRSUAPI_ATTRIBUTE_scriptPath"; break;
1416                         case DRSUAPI_ATTRIBUTE_profilePath: val = "DRSUAPI_ATTRIBUTE_profilePath"; break;
1417                         case DRSUAPI_ATTRIBUTE_objectSid: val = "DRSUAPI_ATTRIBUTE_objectSid"; break;
1418                         case DRSUAPI_ATTRIBUTE_schemaIDGUID: val = "DRSUAPI_ATTRIBUTE_schemaIDGUID"; break;
1419                         case DRSUAPI_ATTRIBUTE_dBCSPwd: val = "DRSUAPI_ATTRIBUTE_dBCSPwd"; break;
1420                         case DRSUAPI_ATTRIBUTE_logonHours: val = "DRSUAPI_ATTRIBUTE_logonHours"; break;
1421                         case DRSUAPI_ATTRIBUTE_userWorkstations: val = "DRSUAPI_ATTRIBUTE_userWorkstations"; break;
1422                         case DRSUAPI_ATTRIBUTE_unicodePwd: val = "DRSUAPI_ATTRIBUTE_unicodePwd"; break;
1423                         case DRSUAPI_ATTRIBUTE_ntPwdHistory: val = "DRSUAPI_ATTRIBUTE_ntPwdHistory"; break;
1424                         case DRSUAPI_ATTRIBUTE_priorValue: val = "DRSUAPI_ATTRIBUTE_priorValue"; break;
1425                         case DRSUAPI_ATTRIBUTE_supplementalCredentials: val = "DRSUAPI_ATTRIBUTE_supplementalCredentials"; break;
1426                         case DRSUAPI_ATTRIBUTE_trustAuthIncoming: val = "DRSUAPI_ATTRIBUTE_trustAuthIncoming"; break;
1427                         case DRSUAPI_ATTRIBUTE_trustAuthOutgoing: val = "DRSUAPI_ATTRIBUTE_trustAuthOutgoing"; break;
1428                         case DRSUAPI_ATTRIBUTE_lmPwdHistory: val = "DRSUAPI_ATTRIBUTE_lmPwdHistory"; break;
1429                         case DRSUAPI_ATTRIBUTE_systemPossSuperiors: val = "DRSUAPI_ATTRIBUTE_systemPossSuperiors"; break;
1430                         case DRSUAPI_ATTRIBUTE_systemMayContain: val = "DRSUAPI_ATTRIBUTE_systemMayContain"; break;
1431                         case DRSUAPI_ATTRIBUTE_systemMustContain: val = "DRSUAPI_ATTRIBUTE_systemMustContain"; break;
1432                         case DRSUAPI_ATTRIBUTE_systemAuxiliaryClass: val = "DRSUAPI_ATTRIBUTE_systemAuxiliaryClass"; break;
1433                         case DRSUAPI_ATTRIBUTE_sAMAccountName: val = "DRSUAPI_ATTRIBUTE_sAMAccountName"; break;
1434                         case DRSUAPI_ATTRIBUTE_sAMAccountType: val = "DRSUAPI_ATTRIBUTE_sAMAccountType"; break;
1435                         case DRSUAPI_ATTRIBUTE_fSMORoleOwner: val = "DRSUAPI_ATTRIBUTE_fSMORoleOwner"; break;
1436                         case DRSUAPI_ATTRIBUTE_systemFlags: val = "DRSUAPI_ATTRIBUTE_systemFlags"; break;
1437                         case DRSUAPI_ATTRIBUTE_serverReference: val = "DRSUAPI_ATTRIBUTE_serverReference"; break;
1438                         case DRSUAPI_ATTRIBUTE_serverReferenceBL: val = "DRSUAPI_ATTRIBUTE_serverReferenceBL"; break;
1439                         case DRSUAPI_ATTRIBUTE_initialAuthIncoming: val = "DRSUAPI_ATTRIBUTE_initialAuthIncoming"; break;
1440                         case DRSUAPI_ATTRIBUTE_initialAuthOutgoing: val = "DRSUAPI_ATTRIBUTE_initialAuthOutgoing"; break;
1441                         case DRSUAPI_ATTRIBUTE_wellKnownObjects: val = "DRSUAPI_ATTRIBUTE_wellKnownObjects"; break;
1442                         case DRSUAPI_ATTRIBUTE_dNSHostName: val = "DRSUAPI_ATTRIBUTE_dNSHostName"; break;
1443                         case DRSUAPI_ATTRIBUTE_isMemberOfPartialAttributeSet: val = "DRSUAPI_ATTRIBUTE_isMemberOfPartialAttributeSet"; break;
1444                         case DRSUAPI_ATTRIBUTE_userPrincipalName: val = "DRSUAPI_ATTRIBUTE_userPrincipalName"; break;
1445                         case DRSUAPI_ATTRIBUTE_groupType: val = "DRSUAPI_ATTRIBUTE_groupType"; break;
1446                         case DRSUAPI_ATTRIBUTE_servicePrincipalName: val = "DRSUAPI_ATTRIBUTE_servicePrincipalName"; break;
1447                         case DRSUAPI_ATTRIBUTE_objectCategory: val = "DRSUAPI_ATTRIBUTE_objectCategory"; break;
1448                         case DRSUAPI_ATTRIBUTE_gPLink: val = "DRSUAPI_ATTRIBUTE_gPLink"; break;
1449                         case DRSUAPI_ATTRIBUTE_transportAddressAttribute: val = "DRSUAPI_ATTRIBUTE_transportAddressAttribute"; break;
1450                         case DRSUAPI_ATTRIBUTE_msDS_Behavior_Version: val = "DRSUAPI_ATTRIBUTE_msDS_Behavior_Version"; break;
1451                         case DRSUAPI_ATTRIBUTE_msDS_KeyVersionNumber: val = "DRSUAPI_ATTRIBUTE_msDS_KeyVersionNumber"; break;
1452                         case DRSUAPI_ATTRIBUTE_msDS_HasDomainNCs: val = "DRSUAPI_ATTRIBUTE_msDS_HasDomainNCs"; break;
1453                         case DRSUAPI_ATTRIBUTE_msDS_hasMasterNCs: val = "DRSUAPI_ATTRIBUTE_msDS_hasMasterNCs"; break;
1454                         case DRSUAPI_ATTRIBUTE_NONE: val = "DRSUAPI_ATTRIBUTE_NONE"; break;
1455                 }
1456                 ndr_print_enum(ndr, name, "ENUM", val, r);
1457                 ndr->flags = _flags_save_ENUM;
1458         }
1459 }
1460
1461 static enum ndr_err_code ndr_push_drsuapi_DsPartialAttributeSet(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsPartialAttributeSet *r)
1462 {
1463         uint32_t cntr_attids_0;
1464         if (ndr_flags & NDR_SCALARS) {
1465                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->num_attids));
1466                 NDR_CHECK(ndr_push_align(ndr, 4));
1467                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 1));
1468                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
1469                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_attids));
1470                 for (cntr_attids_0 = 0; cntr_attids_0 < r->num_attids; cntr_attids_0++) {
1471                         NDR_CHECK(ndr_push_drsuapi_DsAttributeId(ndr, NDR_SCALARS, r->attids[cntr_attids_0]));
1472                 }
1473                 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
1474         }
1475         if (ndr_flags & NDR_BUFFERS) {
1476         }
1477         return NDR_ERR_SUCCESS;
1478 }
1479
1480 static enum ndr_err_code ndr_pull_drsuapi_DsPartialAttributeSet(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsPartialAttributeSet *r)
1481 {
1482         uint32_t cntr_attids_0;
1483         TALLOC_CTX *_mem_save_attids_0;
1484         if (ndr_flags & NDR_SCALARS) {
1485                 NDR_CHECK(ndr_pull_array_size(ndr, &r->attids));
1486                 NDR_CHECK(ndr_pull_align(ndr, 4));
1487                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
1488                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved1));
1489                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_attids));
1490                 if (r->num_attids < 1 || r->num_attids > 0x100000) {
1491                         return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
1492                 }
1493                 NDR_PULL_ALLOC_N(ndr, r->attids, ndr_get_array_size(ndr, &r->attids));
1494                 _mem_save_attids_0 = NDR_PULL_GET_MEM_CTX(ndr);
1495                 NDR_PULL_SET_MEM_CTX(ndr, r->attids, 0);
1496                 for (cntr_attids_0 = 0; cntr_attids_0 < r->num_attids; cntr_attids_0++) {
1497                         NDR_CHECK(ndr_pull_drsuapi_DsAttributeId(ndr, NDR_SCALARS, &r->attids[cntr_attids_0]));
1498                 }
1499                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attids_0, 0);
1500                 if (r->attids) {
1501                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->attids, r->num_attids));
1502                 }
1503                 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
1504         }
1505         if (ndr_flags & NDR_BUFFERS) {
1506         }
1507         return NDR_ERR_SUCCESS;
1508 }
1509
1510 _PUBLIC_ void ndr_print_drsuapi_DsPartialAttributeSet(struct ndr_print *ndr, const char *name, const struct drsuapi_DsPartialAttributeSet *r)
1511 {
1512         uint32_t cntr_attids_0;
1513         ndr_print_struct(ndr, name, "drsuapi_DsPartialAttributeSet");
1514         ndr->depth++;
1515         ndr_print_uint32(ndr, "version", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?1:r->version);
1516         ndr_print_uint32(ndr, "reserved1", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved1);
1517         ndr_print_uint32(ndr, "num_attids", r->num_attids);
1518         ndr->print(ndr, "%s: ARRAY(%d)", "attids", (int)r->num_attids);
1519         ndr->depth++;
1520         for (cntr_attids_0=0;cntr_attids_0<r->num_attids;cntr_attids_0++) {
1521                 char *idx_0=NULL;
1522                 if (asprintf(&idx_0, "[%d]", cntr_attids_0) != -1) {
1523                         ndr_print_drsuapi_DsAttributeId(ndr, "attids", r->attids[cntr_attids_0]);
1524                         free(idx_0);
1525                 }
1526         }
1527         ndr->depth--;
1528         ndr->depth--;
1529 }
1530
1531 static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesRequest8(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesRequest8 *r)
1532 {
1533         if (ndr_flags & NDR_SCALARS) {
1534                 NDR_CHECK(ndr_push_align(ndr, 8));
1535                 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->destination_dsa_guid));
1536                 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
1537                 if (r->naming_context == NULL) {
1538                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1539                 }
1540                 NDR_CHECK(ndr_push_ref_ptr(ndr));
1541                 NDR_CHECK(ndr_push_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->highwatermark));
1542                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->uptodateness_vector));
1543                 NDR_CHECK(ndr_push_drsuapi_DsReplicaNeighbourFlags(ndr, NDR_SCALARS, r->replica_flags));
1544                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_object_count));
1545                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_ndr_size));
1546                 NDR_CHECK(ndr_push_drsuapi_DsExtendedOperation(ndr, NDR_SCALARS, r->extended_op));
1547                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->fsmo_info));
1548                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->partial_attribute_set));
1549                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->partial_attribute_set_ex));
1550                 NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_SCALARS, &r->mapping_ctr));
1551                 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
1552         }
1553         if (ndr_flags & NDR_BUFFERS) {
1554                 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
1555                 if (r->uptodateness_vector) {
1556                         NDR_CHECK(ndr_push_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->uptodateness_vector));
1557                 }
1558                 if (r->partial_attribute_set) {
1559                         NDR_CHECK(ndr_push_drsuapi_DsPartialAttributeSet(ndr, NDR_SCALARS, r->partial_attribute_set));
1560                 }
1561                 if (r->partial_attribute_set_ex) {
1562                         NDR_CHECK(ndr_push_drsuapi_DsPartialAttributeSet(ndr, NDR_SCALARS, r->partial_attribute_set_ex));
1563                 }
1564                 NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->mapping_ctr));
1565         }
1566         return NDR_ERR_SUCCESS;
1567 }
1568
1569 static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesRequest8(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesRequest8 *r)
1570 {
1571         uint32_t _ptr_naming_context;
1572         TALLOC_CTX *_mem_save_naming_context_0;
1573         uint32_t _ptr_uptodateness_vector;
1574         TALLOC_CTX *_mem_save_uptodateness_vector_0;
1575         uint32_t _ptr_partial_attribute_set;
1576         TALLOC_CTX *_mem_save_partial_attribute_set_0;
1577         uint32_t _ptr_partial_attribute_set_ex;
1578         TALLOC_CTX *_mem_save_partial_attribute_set_ex_0;
1579         if (ndr_flags & NDR_SCALARS) {
1580                 NDR_CHECK(ndr_pull_align(ndr, 8));
1581                 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->destination_dsa_guid));
1582                 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
1583                 NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_naming_context));
1584                 if (_ptr_naming_context) {
1585                         NDR_PULL_ALLOC(ndr, r->naming_context);
1586                 } else {
1587                         r->naming_context = NULL;
1588                 }
1589                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->highwatermark));
1590                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_uptodateness_vector));
1591                 if (_ptr_uptodateness_vector) {
1592                         NDR_PULL_ALLOC(ndr, r->uptodateness_vector);
1593                 } else {
1594                         r->uptodateness_vector = NULL;
1595                 }
1596                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaNeighbourFlags(ndr, NDR_SCALARS, &r->replica_flags));
1597                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_object_count));
1598                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_ndr_size));
1599                 NDR_CHECK(ndr_pull_drsuapi_DsExtendedOperation(ndr, NDR_SCALARS, &r->extended_op));
1600                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->fsmo_info));
1601                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_partial_attribute_set));
1602                 if (_ptr_partial_attribute_set) {
1603                         NDR_PULL_ALLOC(ndr, r->partial_attribute_set);
1604                 } else {
1605                         r->partial_attribute_set = NULL;
1606                 }
1607                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_partial_attribute_set_ex));
1608                 if (_ptr_partial_attribute_set_ex) {
1609                         NDR_PULL_ALLOC(ndr, r->partial_attribute_set_ex);
1610                 } else {
1611                         r->partial_attribute_set_ex = NULL;
1612                 }
1613                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_SCALARS, &r->mapping_ctr));
1614                 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
1615         }
1616         if (ndr_flags & NDR_BUFFERS) {
1617                 _mem_save_naming_context_0 = NDR_PULL_GET_MEM_CTX(ndr);
1618                 NDR_PULL_SET_MEM_CTX(ndr, r->naming_context, 0);
1619                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
1620                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_naming_context_0, 0);
1621                 if (r->uptodateness_vector) {
1622                         _mem_save_uptodateness_vector_0 = NDR_PULL_GET_MEM_CTX(ndr);
1623                         NDR_PULL_SET_MEM_CTX(ndr, r->uptodateness_vector, 0);
1624                         NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->uptodateness_vector));
1625                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_uptodateness_vector_0, 0);
1626                 }
1627                 if (r->partial_attribute_set) {
1628                         _mem_save_partial_attribute_set_0 = NDR_PULL_GET_MEM_CTX(ndr);
1629                         NDR_PULL_SET_MEM_CTX(ndr, r->partial_attribute_set, 0);
1630                         NDR_CHECK(ndr_pull_drsuapi_DsPartialAttributeSet(ndr, NDR_SCALARS, r->partial_attribute_set));
1631                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_partial_attribute_set_0, 0);
1632                 }
1633                 if (r->partial_attribute_set_ex) {
1634                         _mem_save_partial_attribute_set_ex_0 = NDR_PULL_GET_MEM_CTX(ndr);
1635                         NDR_PULL_SET_MEM_CTX(ndr, r->partial_attribute_set_ex, 0);
1636                         NDR_CHECK(ndr_pull_drsuapi_DsPartialAttributeSet(ndr, NDR_SCALARS, r->partial_attribute_set_ex));
1637                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_partial_attribute_set_ex_0, 0);
1638                 }
1639                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->mapping_ctr));
1640         }
1641         return NDR_ERR_SUCCESS;
1642 }
1643
1644 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesRequest8(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesRequest8 *r)
1645 {
1646         ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesRequest8");
1647         ndr->depth++;
1648         ndr_print_GUID(ndr, "destination_dsa_guid", &r->destination_dsa_guid);
1649         ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id);
1650         ndr_print_ptr(ndr, "naming_context", r->naming_context);
1651         ndr->depth++;
1652         ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "naming_context", r->naming_context);
1653         ndr->depth--;
1654         ndr_print_drsuapi_DsReplicaHighWaterMark(ndr, "highwatermark", &r->highwatermark);
1655         ndr_print_ptr(ndr, "uptodateness_vector", r->uptodateness_vector);
1656         ndr->depth++;
1657         if (r->uptodateness_vector) {
1658                 ndr_print_drsuapi_DsReplicaCursorCtrEx(ndr, "uptodateness_vector", r->uptodateness_vector);
1659         }
1660         ndr->depth--;
1661         ndr_print_drsuapi_DsReplicaNeighbourFlags(ndr, "replica_flags", r->replica_flags);
1662         ndr_print_uint32(ndr, "max_object_count", r->max_object_count);
1663         ndr_print_uint32(ndr, "max_ndr_size", r->max_ndr_size);
1664         ndr_print_drsuapi_DsExtendedOperation(ndr, "extended_op", r->extended_op);
1665         ndr_print_hyper(ndr, "fsmo_info", r->fsmo_info);
1666         ndr_print_ptr(ndr, "partial_attribute_set", r->partial_attribute_set);
1667         ndr->depth++;
1668         if (r->partial_attribute_set) {
1669                 ndr_print_drsuapi_DsPartialAttributeSet(ndr, "partial_attribute_set", r->partial_attribute_set);
1670         }
1671         ndr->depth--;
1672         ndr_print_ptr(ndr, "partial_attribute_set_ex", r->partial_attribute_set_ex);
1673         ndr->depth++;
1674         if (r->partial_attribute_set_ex) {
1675                 ndr_print_drsuapi_DsPartialAttributeSet(ndr, "partial_attribute_set_ex", r->partial_attribute_set_ex);
1676         }
1677         ndr->depth--;
1678         ndr_print_drsuapi_DsReplicaOIDMapping_Ctr(ndr, "mapping_ctr", &r->mapping_ctr);
1679         ndr->depth--;
1680 }
1681
1682 static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesRequest10(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesRequest10 *r)
1683 {
1684         if (ndr_flags & NDR_SCALARS) {
1685                 NDR_CHECK(ndr_push_align(ndr, 8));
1686                 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->destination_dsa_guid));
1687                 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
1688                 if (r->naming_context == NULL) {
1689                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1690                 }
1691                 NDR_CHECK(ndr_push_ref_ptr(ndr));
1692                 NDR_CHECK(ndr_push_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->highwatermark));
1693                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->uptodateness_vector));
1694                 NDR_CHECK(ndr_push_drsuapi_DsReplicaNeighbourFlags(ndr, NDR_SCALARS, r->replica_flags));
1695                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_object_count));
1696                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_ndr_size));
1697                 NDR_CHECK(ndr_push_drsuapi_DsExtendedOperation(ndr, NDR_SCALARS, r->extended_op));
1698                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->fsmo_info));
1699                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->partial_attribute_set));
1700                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->partial_attribute_set_ex));
1701                 NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_SCALARS, &r->mapping_ctr));
1702                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->more_flags));
1703                 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
1704         }
1705         if (ndr_flags & NDR_BUFFERS) {
1706                 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
1707                 if (r->uptodateness_vector) {
1708                         NDR_CHECK(ndr_push_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->uptodateness_vector));
1709                 }
1710                 if (r->partial_attribute_set) {
1711                         NDR_CHECK(ndr_push_drsuapi_DsPartialAttributeSet(ndr, NDR_SCALARS, r->partial_attribute_set));
1712                 }
1713                 if (r->partial_attribute_set_ex) {
1714                         NDR_CHECK(ndr_push_drsuapi_DsPartialAttributeSet(ndr, NDR_SCALARS, r->partial_attribute_set_ex));
1715                 }
1716                 NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->mapping_ctr));
1717         }
1718         return NDR_ERR_SUCCESS;
1719 }
1720
1721 static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesRequest10(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesRequest10 *r)
1722 {
1723         uint32_t _ptr_naming_context;
1724         TALLOC_CTX *_mem_save_naming_context_0;
1725         uint32_t _ptr_uptodateness_vector;
1726         TALLOC_CTX *_mem_save_uptodateness_vector_0;
1727         uint32_t _ptr_partial_attribute_set;
1728         TALLOC_CTX *_mem_save_partial_attribute_set_0;
1729         uint32_t _ptr_partial_attribute_set_ex;
1730         TALLOC_CTX *_mem_save_partial_attribute_set_ex_0;
1731         if (ndr_flags & NDR_SCALARS) {
1732                 NDR_CHECK(ndr_pull_align(ndr, 8));
1733                 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->destination_dsa_guid));
1734                 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
1735                 NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_naming_context));
1736                 if (_ptr_naming_context) {
1737                         NDR_PULL_ALLOC(ndr, r->naming_context);
1738                 } else {
1739                         r->naming_context = NULL;
1740                 }
1741                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->highwatermark));
1742                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_uptodateness_vector));
1743                 if (_ptr_uptodateness_vector) {
1744                         NDR_PULL_ALLOC(ndr, r->uptodateness_vector);
1745                 } else {
1746                         r->uptodateness_vector = NULL;
1747                 }
1748                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaNeighbourFlags(ndr, NDR_SCALARS, &r->replica_flags));
1749                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_object_count));
1750                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_ndr_size));
1751                 NDR_CHECK(ndr_pull_drsuapi_DsExtendedOperation(ndr, NDR_SCALARS, &r->extended_op));
1752                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->fsmo_info));
1753                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_partial_attribute_set));
1754                 if (_ptr_partial_attribute_set) {
1755                         NDR_PULL_ALLOC(ndr, r->partial_attribute_set);
1756                 } else {
1757                         r->partial_attribute_set = NULL;
1758                 }
1759                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_partial_attribute_set_ex));
1760                 if (_ptr_partial_attribute_set_ex) {
1761                         NDR_PULL_ALLOC(ndr, r->partial_attribute_set_ex);
1762                 } else {
1763                         r->partial_attribute_set_ex = NULL;
1764                 }
1765                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_SCALARS, &r->mapping_ctr));
1766                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->more_flags));
1767                 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
1768         }
1769         if (ndr_flags & NDR_BUFFERS) {
1770                 _mem_save_naming_context_0 = NDR_PULL_GET_MEM_CTX(ndr);
1771                 NDR_PULL_SET_MEM_CTX(ndr, r->naming_context, 0);
1772                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
1773                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_naming_context_0, 0);
1774                 if (r->uptodateness_vector) {
1775                         _mem_save_uptodateness_vector_0 = NDR_PULL_GET_MEM_CTX(ndr);
1776                         NDR_PULL_SET_MEM_CTX(ndr, r->uptodateness_vector, 0);
1777                         NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->uptodateness_vector));
1778                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_uptodateness_vector_0, 0);
1779                 }
1780                 if (r->partial_attribute_set) {
1781                         _mem_save_partial_attribute_set_0 = NDR_PULL_GET_MEM_CTX(ndr);
1782                         NDR_PULL_SET_MEM_CTX(ndr, r->partial_attribute_set, 0);
1783                         NDR_CHECK(ndr_pull_drsuapi_DsPartialAttributeSet(ndr, NDR_SCALARS, r->partial_attribute_set));
1784                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_partial_attribute_set_0, 0);
1785                 }
1786                 if (r->partial_attribute_set_ex) {
1787                         _mem_save_partial_attribute_set_ex_0 = NDR_PULL_GET_MEM_CTX(ndr);
1788                         NDR_PULL_SET_MEM_CTX(ndr, r->partial_attribute_set_ex, 0);
1789                         NDR_CHECK(ndr_pull_drsuapi_DsPartialAttributeSet(ndr, NDR_SCALARS, r->partial_attribute_set_ex));
1790                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_partial_attribute_set_ex_0, 0);
1791                 }
1792                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->mapping_ctr));
1793         }
1794         return NDR_ERR_SUCCESS;
1795 }
1796
1797 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesRequest10(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesRequest10 *r)
1798 {
1799         ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesRequest10");
1800         ndr->depth++;
1801         ndr_print_GUID(ndr, "destination_dsa_guid", &r->destination_dsa_guid);
1802         ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id);
1803         ndr_print_ptr(ndr, "naming_context", r->naming_context);
1804         ndr->depth++;
1805         ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "naming_context", r->naming_context);
1806         ndr->depth--;
1807         ndr_print_drsuapi_DsReplicaHighWaterMark(ndr, "highwatermark", &r->highwatermark);
1808         ndr_print_ptr(ndr, "uptodateness_vector", r->uptodateness_vector);
1809         ndr->depth++;
1810         if (r->uptodateness_vector) {
1811                 ndr_print_drsuapi_DsReplicaCursorCtrEx(ndr, "uptodateness_vector", r->uptodateness_vector);
1812         }
1813         ndr->depth--;
1814         ndr_print_drsuapi_DsReplicaNeighbourFlags(ndr, "replica_flags", r->replica_flags);
1815         ndr_print_uint32(ndr, "max_object_count", r->max_object_count);
1816         ndr_print_uint32(ndr, "max_ndr_size", r->max_ndr_size);
1817         ndr_print_drsuapi_DsExtendedOperation(ndr, "extended_op", r->extended_op);
1818         ndr_print_hyper(ndr, "fsmo_info", r->fsmo_info);
1819         ndr_print_ptr(ndr, "partial_attribute_set", r->partial_attribute_set);
1820         ndr->depth++;
1821         if (r->partial_attribute_set) {
1822                 ndr_print_drsuapi_DsPartialAttributeSet(ndr, "partial_attribute_set", r->partial_attribute_set);
1823         }
1824         ndr->depth--;
1825         ndr_print_ptr(ndr, "partial_attribute_set_ex", r->partial_attribute_set_ex);
1826         ndr->depth++;
1827         if (r->partial_attribute_set_ex) {
1828                 ndr_print_drsuapi_DsPartialAttributeSet(ndr, "partial_attribute_set_ex", r->partial_attribute_set_ex);
1829         }
1830         ndr->depth--;
1831         ndr_print_drsuapi_DsReplicaOIDMapping_Ctr(ndr, "mapping_ctr", &r->mapping_ctr);
1832         ndr_print_uint32(ndr, "more_flags", r->more_flags);
1833         ndr->depth--;
1834 }
1835
1836 static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetNCChangesRequest *r)
1837 {
1838         if (ndr_flags & NDR_SCALARS) {
1839                 int level = ndr_push_get_switch_value(ndr, r);
1840                 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
1841                 NDR_CHECK(ndr_push_union_align(ndr, 8));
1842                 switch (level) {
1843                         case 5: {
1844                                 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesRequest5(ndr, NDR_SCALARS, &r->req5));
1845                         break; }
1846
1847                         case 8: {
1848                                 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesRequest8(ndr, NDR_SCALARS, &r->req8));
1849                         break; }
1850
1851                         case 10: {
1852                                 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesRequest10(ndr, NDR_SCALARS, &r->req10));
1853                         break; }
1854
1855                         default:
1856                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1857                 }
1858         }
1859         if (ndr_flags & NDR_BUFFERS) {
1860                 int level = ndr_push_get_switch_value(ndr, r);
1861                 switch (level) {
1862                         case 5:
1863                                 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesRequest5(ndr, NDR_BUFFERS, &r->req5));
1864                         break;
1865
1866                         case 8:
1867                                 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesRequest8(ndr, NDR_BUFFERS, &r->req8));
1868                         break;
1869
1870                         case 10:
1871                                 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesRequest10(ndr, NDR_BUFFERS, &r->req10));
1872                         break;
1873
1874                         default:
1875                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1876                 }
1877         }
1878         return NDR_ERR_SUCCESS;
1879 }
1880
1881 static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetNCChangesRequest *r)
1882 {
1883         int level;
1884         int32_t _level;
1885         level = ndr_pull_get_switch_value(ndr, r);
1886         if (ndr_flags & NDR_SCALARS) {
1887                 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
1888                 if (_level != level) {
1889                         return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
1890                 }
1891                 NDR_CHECK(ndr_pull_union_align(ndr, 8));
1892                 switch (level) {
1893                         case 5: {
1894                                 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesRequest5(ndr, NDR_SCALARS, &r->req5));
1895                         break; }
1896
1897                         case 8: {
1898                                 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesRequest8(ndr, NDR_SCALARS, &r->req8));
1899                         break; }
1900
1901                         case 10: {
1902                                 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesRequest10(ndr, NDR_SCALARS, &r->req10));
1903                         break; }
1904
1905                         default:
1906                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1907                 }
1908         }
1909         if (ndr_flags & NDR_BUFFERS) {
1910                 switch (level) {
1911                         case 5:
1912                                 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesRequest5(ndr, NDR_BUFFERS, &r->req5));
1913                         break;
1914
1915                         case 8:
1916                                 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesRequest8(ndr, NDR_BUFFERS, &r->req8));
1917                         break;
1918
1919                         case 10:
1920                                 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesRequest10(ndr, NDR_BUFFERS, &r->req10));
1921                         break;
1922
1923                         default:
1924                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1925                 }
1926         }
1927         return NDR_ERR_SUCCESS;
1928 }
1929
1930 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetNCChangesRequest *r)
1931 {
1932         int level;
1933         level = ndr_print_get_switch_value(ndr, r);
1934         ndr_print_union(ndr, name, level, "drsuapi_DsGetNCChangesRequest");
1935         switch (level) {
1936                 case 5:
1937                         ndr_print_drsuapi_DsGetNCChangesRequest5(ndr, "req5", &r->req5);
1938                 break;
1939
1940                 case 8:
1941                         ndr_print_drsuapi_DsGetNCChangesRequest8(ndr, "req8", &r->req8);
1942                 break;
1943
1944                 case 10:
1945                         ndr_print_drsuapi_DsGetNCChangesRequest10(ndr, "req10", &r->req10);
1946                 break;
1947
1948                 default:
1949                         ndr_print_bad_level(ndr, name, level);
1950         }
1951 }
1952
1953 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaCursor2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursor2 *r)
1954 {
1955         if (ndr_flags & NDR_SCALARS) {
1956                 NDR_CHECK(ndr_push_align(ndr, 8));
1957                 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
1958                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->highest_usn));
1959                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_sync_success));
1960                 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
1961         }
1962         if (ndr_flags & NDR_BUFFERS) {
1963         }
1964         return NDR_ERR_SUCCESS;
1965 }
1966
1967 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursor2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursor2 *r)
1968 {
1969         if (ndr_flags & NDR_SCALARS) {
1970                 NDR_CHECK(ndr_pull_align(ndr, 8));
1971                 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
1972                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->highest_usn));
1973                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_sync_success));
1974                 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
1975         }
1976         if (ndr_flags & NDR_BUFFERS) {
1977         }
1978         return NDR_ERR_SUCCESS;
1979 }
1980
1981 _PUBLIC_ void ndr_print_drsuapi_DsReplicaCursor2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursor2 *r)
1982 {
1983         ndr_print_struct(ndr, name, "drsuapi_DsReplicaCursor2");
1984         ndr->depth++;
1985         ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id);
1986         ndr_print_hyper(ndr, "highest_usn", r->highest_usn);
1987         ndr_print_NTTIME(ndr, "last_sync_success", r->last_sync_success);
1988         ndr->depth--;
1989 }
1990
1991 static enum ndr_err_code ndr_push_drsuapi_DsReplicaCursor2CtrEx(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursor2CtrEx *r)
1992 {
1993         uint32_t cntr_cursors_0;
1994         if (ndr_flags & NDR_SCALARS) {
1995                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
1996                 NDR_CHECK(ndr_push_align(ndr, 8));
1997                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 2));
1998                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
1999                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
2000                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
2001                 for (cntr_cursors_0 = 0; cntr_cursors_0 < r->count; cntr_cursors_0++) {
2002                         NDR_CHECK(ndr_push_drsuapi_DsReplicaCursor2(ndr, NDR_SCALARS, &r->cursors[cntr_cursors_0]));
2003                 }
2004                 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
2005         }
2006         if (ndr_flags & NDR_BUFFERS) {
2007         }
2008         return NDR_ERR_SUCCESS;
2009 }
2010
2011 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursor2CtrEx(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursor2CtrEx *r)
2012 {
2013         uint32_t cntr_cursors_0;
2014         TALLOC_CTX *_mem_save_cursors_0;
2015         if (ndr_flags & NDR_SCALARS) {
2016                 NDR_CHECK(ndr_pull_array_size(ndr, &r->cursors));
2017                 NDR_CHECK(ndr_pull_align(ndr, 8));
2018                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
2019                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved1));
2020                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
2021                 if (r->count > 0x100000) {
2022                         return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
2023                 }
2024                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved2));
2025                 NDR_PULL_ALLOC_N(ndr, r->cursors, ndr_get_array_size(ndr, &r->cursors));
2026                 _mem_save_cursors_0 = NDR_PULL_GET_MEM_CTX(ndr);
2027                 NDR_PULL_SET_MEM_CTX(ndr, r->cursors, 0);
2028                 for (cntr_cursors_0 = 0; cntr_cursors_0 < r->count; cntr_cursors_0++) {
2029                         NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursor2(ndr, NDR_SCALARS, &r->cursors[cntr_cursors_0]));
2030                 }
2031                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_cursors_0, 0);
2032                 if (r->cursors) {
2033                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->cursors, r->count));
2034                 }
2035                 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
2036         }
2037         if (ndr_flags & NDR_BUFFERS) {
2038         }
2039         return NDR_ERR_SUCCESS;
2040 }
2041
2042 _PUBLIC_ void ndr_print_drsuapi_DsReplicaCursor2CtrEx(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursor2CtrEx *r)
2043 {
2044         uint32_t cntr_cursors_0;
2045         ndr_print_struct(ndr, name, "drsuapi_DsReplicaCursor2CtrEx");
2046         ndr->depth++;
2047         ndr_print_uint32(ndr, "version", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?2:r->version);
2048         ndr_print_uint32(ndr, "reserved1", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved1);
2049         ndr_print_uint32(ndr, "count", r->count);
2050         ndr_print_uint32(ndr, "reserved2", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved2);
2051         ndr->print(ndr, "%s: ARRAY(%d)", "cursors", (int)r->count);
2052         ndr->depth++;
2053         for (cntr_cursors_0=0;cntr_cursors_0<r->count;cntr_cursors_0++) {
2054                 char *idx_0=NULL;
2055                 if (asprintf(&idx_0, "[%d]", cntr_cursors_0) != -1) {
2056                         ndr_print_drsuapi_DsReplicaCursor2(ndr, "cursors", &r->cursors[cntr_cursors_0]);
2057                         free(idx_0);
2058                 }
2059         }
2060         ndr->depth--;
2061         ndr->depth--;
2062 }
2063
2064 static enum ndr_err_code ndr_push_drsuapi_DsAttributeValue(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAttributeValue *r)
2065 {
2066         if (ndr_flags & NDR_SCALARS) {
2067                 NDR_CHECK(ndr_push_align(ndr, 5));
2068                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_DATA_BLOB(0, r->blob, 0)));
2069                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->blob));
2070                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
2071         }
2072         if (ndr_flags & NDR_BUFFERS) {
2073                 if (r->blob) {
2074                         NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, *r->blob));
2075                 }
2076         }
2077         return NDR_ERR_SUCCESS;
2078 }
2079
2080 static enum ndr_err_code ndr_pull_drsuapi_DsAttributeValue(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAttributeValue *r)
2081 {
2082         uint32_t _ptr_blob;
2083         TALLOC_CTX *_mem_save_blob_0;
2084         if (ndr_flags & NDR_SCALARS) {
2085                 NDR_CHECK(ndr_pull_align(ndr, 5));
2086                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size));
2087                 if (r->__ndr_size > 10485760) {
2088                         return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
2089                 }
2090                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_blob));
2091                 if (_ptr_blob) {
2092                         NDR_PULL_ALLOC(ndr, r->blob);
2093                 } else {
2094                         r->blob = NULL;
2095                 }
2096                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
2097         }
2098         if (ndr_flags & NDR_BUFFERS) {
2099                 if (r->blob) {
2100                         _mem_save_blob_0 = NDR_PULL_GET_MEM_CTX(ndr);
2101                         NDR_PULL_SET_MEM_CTX(ndr, r->blob, 0);
2102                         NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, r->blob));
2103                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_blob_0, 0);
2104                 }
2105         }
2106         return NDR_ERR_SUCCESS;
2107 }
2108
2109 _PUBLIC_ void ndr_print_drsuapi_DsAttributeValue(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAttributeValue *r)
2110 {
2111         ndr_print_struct(ndr, name, "drsuapi_DsAttributeValue");
2112         ndr->depth++;
2113         ndr_print_uint32(ndr, "__ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_DATA_BLOB(0, r->blob, 0):r->__ndr_size);
2114         ndr_print_ptr(ndr, "blob", r->blob);
2115         ndr->depth++;
2116         if (r->blob) {
2117                 ndr_print_DATA_BLOB(ndr, "blob", *r->blob);
2118         }
2119         ndr->depth--;
2120         ndr->depth--;
2121 }
2122
2123 static enum ndr_err_code ndr_push_drsuapi_DsAttributeValueCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAttributeValueCtr *r)
2124 {
2125         uint32_t cntr_values_1;
2126         if (ndr_flags & NDR_SCALARS) {
2127                 NDR_CHECK(ndr_push_align(ndr, 5));
2128                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_values));
2129                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->values));
2130                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
2131         }
2132         if (ndr_flags & NDR_BUFFERS) {
2133                 if (r->values) {
2134                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->num_values));
2135                         for (cntr_values_1 = 0; cntr_values_1 < r->num_values; cntr_values_1++) {
2136                                 NDR_CHECK(ndr_push_drsuapi_DsAttributeValue(ndr, NDR_SCALARS, &r->values[cntr_values_1]));
2137                         }
2138                         for (cntr_values_1 = 0; cntr_values_1 < r->num_values; cntr_values_1++) {
2139                                 NDR_CHECK(ndr_push_drsuapi_DsAttributeValue(ndr, NDR_BUFFERS, &r->values[cntr_values_1]));
2140                         }
2141                 }
2142         }
2143         return NDR_ERR_SUCCESS;
2144 }
2145
2146 static enum ndr_err_code ndr_pull_drsuapi_DsAttributeValueCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAttributeValueCtr *r)
2147 {
2148         uint32_t _ptr_values;
2149         uint32_t cntr_values_1;
2150         TALLOC_CTX *_mem_save_values_0;
2151         TALLOC_CTX *_mem_save_values_1;
2152         if (ndr_flags & NDR_SCALARS) {
2153                 NDR_CHECK(ndr_pull_align(ndr, 5));
2154                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_values));
2155                 if (r->num_values > 10485760) {
2156                         return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
2157                 }
2158                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_values));
2159                 if (_ptr_values) {
2160                         NDR_PULL_ALLOC(ndr, r->values);
2161                 } else {
2162                         r->values = NULL;
2163                 }
2164                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
2165         }
2166         if (ndr_flags & NDR_BUFFERS) {
2167                 if (r->values) {
2168                         _mem_save_values_0 = NDR_PULL_GET_MEM_CTX(ndr);
2169                         NDR_PULL_SET_MEM_CTX(ndr, r->values, 0);
2170                         NDR_CHECK(ndr_pull_array_size(ndr, &r->values));
2171                         NDR_PULL_ALLOC_N(ndr, r->values, ndr_get_array_size(ndr, &r->values));
2172                         _mem_save_values_1 = NDR_PULL_GET_MEM_CTX(ndr);
2173                         NDR_PULL_SET_MEM_CTX(ndr, r->values, 0);
2174                         for (cntr_values_1 = 0; cntr_values_1 < r->num_values; cntr_values_1++) {
2175                                 NDR_CHECK(ndr_pull_drsuapi_DsAttributeValue(ndr, NDR_SCALARS, &r->values[cntr_values_1]));
2176                         }
2177                         for (cntr_values_1 = 0; cntr_values_1 < r->num_values; cntr_values_1++) {
2178                                 NDR_CHECK(ndr_pull_drsuapi_DsAttributeValue(ndr, NDR_BUFFERS, &r->values[cntr_values_1]));
2179                         }
2180                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_values_1, 0);
2181                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_values_0, 0);
2182                 }
2183                 if (r->values) {
2184                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->values, r->num_values));
2185                 }
2186         }
2187         return NDR_ERR_SUCCESS;
2188 }
2189
2190 _PUBLIC_ void ndr_print_drsuapi_DsAttributeValueCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAttributeValueCtr *r)
2191 {
2192         uint32_t cntr_values_1;
2193         ndr_print_struct(ndr, name, "drsuapi_DsAttributeValueCtr");
2194         ndr->depth++;
2195         ndr_print_uint32(ndr, "num_values", r->num_values);
2196         ndr_print_ptr(ndr, "values", r->values);
2197         ndr->depth++;
2198         if (r->values) {
2199                 ndr->print(ndr, "%s: ARRAY(%d)", "values", (int)r->num_values);
2200                 ndr->depth++;
2201                 for (cntr_values_1=0;cntr_values_1<r->num_values;cntr_values_1++) {
2202                         char *idx_1=NULL;
2203                         if (asprintf(&idx_1, "[%d]", cntr_values_1) != -1) {
2204                                 ndr_print_drsuapi_DsAttributeValue(ndr, "values", &r->values[cntr_values_1]);
2205                                 free(idx_1);
2206                         }
2207                 }
2208                 ndr->depth--;
2209         }
2210         ndr->depth--;
2211         ndr->depth--;
2212 }
2213
2214 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectIdentifier3(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectIdentifier3 *r)
2215 {
2216         if (ndr_flags & NDR_SCALARS) {
2217                 NDR_CHECK(ndr_push_align(ndr, 4));
2218                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_drsuapi_DsReplicaObjectIdentifier3(r, ndr->iconv_convenience, ndr->flags)));
2219                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_dom_sid28(&r->sid, ndr->flags)));
2220                 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->guid));
2221                 NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_SCALARS, &r->sid));
2222                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m(r->dn)));
2223                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dn, strlen_m(r->dn) + 1, sizeof(uint16_t), CH_UTF16));
2224                 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
2225         }
2226         if (ndr_flags & NDR_BUFFERS) {
2227                 NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_BUFFERS, &r->sid));
2228         }
2229         return NDR_ERR_SUCCESS;
2230 }
2231
2232 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectIdentifier3(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectIdentifier3 *r)
2233 {
2234         if (ndr_flags & NDR_SCALARS) {
2235                 NDR_CHECK(ndr_pull_align(ndr, 4));
2236                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size));
2237                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_sid));
2238                 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->guid));
2239                 NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_SCALARS, &r->sid));
2240                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_dn));
2241                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dn, r->__ndr_size_dn + 1, sizeof(uint16_t), CH_UTF16));
2242                 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
2243         }
2244         if (ndr_flags & NDR_BUFFERS) {
2245                 NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_BUFFERS, &r->sid));
2246         }
2247         return NDR_ERR_SUCCESS;
2248 }
2249
2250 _PUBLIC_ void ndr_print_drsuapi_DsReplicaObjectIdentifier3(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjectIdentifier3 *r)
2251 {
2252         ndr_print_struct(ndr, name, "drsuapi_DsReplicaObjectIdentifier3");
2253         ndr->depth++;
2254         ndr_print_uint32(ndr, "__ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_drsuapi_DsReplicaObjectIdentifier3(r, ndr->iconv_convenience, ndr->flags):r->__ndr_size);
2255         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);
2256         ndr_print_GUID(ndr, "guid", &r->guid);
2257         ndr_print_dom_sid28(ndr, "sid", &r->sid);
2258         ndr_print_uint32(ndr, "__ndr_size_dn", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m(r->dn):r->__ndr_size_dn);
2259         ndr_print_string(ndr, "dn", r->dn);
2260         ndr->depth--;
2261 }
2262
2263 _PUBLIC_ size_t ndr_size_drsuapi_DsReplicaObjectIdentifier3(const struct drsuapi_DsReplicaObjectIdentifier3 *r, struct smb_iconv_convenience *ic, int flags)
2264 {
2265         return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3, ic);
2266 }
2267
2268 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectIdentifier3Binary(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectIdentifier3Binary *r)
2269 {
2270         if (ndr_flags & NDR_SCALARS) {
2271                 NDR_CHECK(ndr_push_align(ndr, 4));
2272                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary_without_Binary(r, ndr->iconv_convenience, ndr->flags)));
2273                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_dom_sid28(&r->sid, ndr->flags)));
2274                 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->guid));
2275                 NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_SCALARS, &r->sid));
2276                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m(r->dn)));
2277                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dn, strlen_m(r->dn) + 1, sizeof(uint16_t), CH_UTF16));
2278                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->binary.length + 4));
2279                 {
2280                         uint32_t _flags_save_DATA_BLOB = ndr->flags;
2281                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
2282                         NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->binary));
2283                         ndr->flags = _flags_save_DATA_BLOB;
2284                 }
2285                 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
2286         }
2287         if (ndr_flags & NDR_BUFFERS) {
2288                 NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_BUFFERS, &r->sid));
2289         }
2290         return NDR_ERR_SUCCESS;
2291 }
2292
2293 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectIdentifier3Binary(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectIdentifier3Binary *r)
2294 {
2295         if (ndr_flags & NDR_SCALARS) {
2296                 NDR_CHECK(ndr_pull_align(ndr, 4));
2297                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size));
2298                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_sid));
2299                 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->guid));
2300                 NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_SCALARS, &r->sid));
2301                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_dn));
2302                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dn, r->__ndr_size_dn + 1, sizeof(uint16_t), CH_UTF16));
2303                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_binary));
2304                 {
2305                         uint32_t _flags_save_DATA_BLOB = ndr->flags;
2306                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
2307                         NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->binary));
2308                         ndr->flags = _flags_save_DATA_BLOB;
2309                 }
2310                 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
2311         }
2312         if (ndr_flags & NDR_BUFFERS) {
2313                 NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_BUFFERS, &r->sid));
2314         }
2315         return NDR_ERR_SUCCESS;
2316 }
2317
2318 _PUBLIC_ void ndr_print_drsuapi_DsReplicaObjectIdentifier3Binary(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjectIdentifier3Binary *r)
2319 {
2320         ndr_print_struct(ndr, name, "drsuapi_DsReplicaObjectIdentifier3Binary");
2321         ndr->depth++;
2322         ndr_print_uint32(ndr, "__ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary_without_Binary(r, ndr->iconv_convenience, ndr->flags):r->__ndr_size);
2323         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);
2324         ndr_print_GUID(ndr, "guid", &r->guid);
2325         ndr_print_dom_sid28(ndr, "sid", &r->sid);
2326         ndr_print_uint32(ndr, "__ndr_size_dn", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m(r->dn):r->__ndr_size_dn);
2327         ndr_print_string(ndr, "dn", r->dn);
2328         ndr_print_uint32(ndr, "__ndr_size_binary", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->binary.length + 4:r->__ndr_size_binary);
2329         ndr_print_DATA_BLOB(ndr, "binary", r->binary);
2330         ndr->depth--;
2331 }
2332
2333 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaAttribute(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaAttribute *r)
2334 {
2335         if (ndr_flags & NDR_SCALARS) {
2336                 NDR_CHECK(ndr_push_align(ndr, 5));
2337                 NDR_CHECK(ndr_push_drsuapi_DsAttributeId(ndr, NDR_SCALARS, r->attid));
2338                 NDR_CHECK(ndr_push_drsuapi_DsAttributeValueCtr(ndr, NDR_SCALARS, &r->value_ctr));
2339                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
2340         }
2341         if (ndr_flags & NDR_BUFFERS) {
2342                 NDR_CHECK(ndr_push_drsuapi_DsAttributeValueCtr(ndr, NDR_BUFFERS, &r->value_ctr));
2343         }
2344         return NDR_ERR_SUCCESS;
2345 }
2346
2347 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaAttribute(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaAttribute *r)
2348 {
2349         if (ndr_flags & NDR_SCALARS) {
2350                 NDR_CHECK(ndr_pull_align(ndr, 5));
2351                 NDR_CHECK(ndr_pull_drsuapi_DsAttributeId(ndr, NDR_SCALARS, &r->attid));
2352                 NDR_CHECK(ndr_pull_drsuapi_DsAttributeValueCtr(ndr, NDR_SCALARS, &r->value_ctr));
2353                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
2354         }
2355         if (ndr_flags & NDR_BUFFERS) {
2356                 NDR_CHECK(ndr_pull_drsuapi_DsAttributeValueCtr(ndr, NDR_BUFFERS, &r->value_ctr));
2357         }
2358         return NDR_ERR_SUCCESS;
2359 }
2360
2361 _PUBLIC_ void ndr_print_drsuapi_DsReplicaAttribute(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaAttribute *r)
2362 {
2363         ndr_print_struct(ndr, name, "drsuapi_DsReplicaAttribute");
2364         ndr->depth++;
2365         ndr_print_drsuapi_DsAttributeId(ndr, "attid", r->attid);
2366         ndr_print_drsuapi_DsAttributeValueCtr(ndr, "value_ctr", &r->value_ctr);
2367         ndr->depth--;
2368 }
2369
2370 static enum ndr_err_code ndr_push_drsuapi_DsReplicaAttributeCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaAttributeCtr *r)
2371 {
2372         uint32_t cntr_attributes_1;
2373         if (ndr_flags & NDR_SCALARS) {
2374                 NDR_CHECK(ndr_push_align(ndr, 5));
2375                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_attributes));
2376                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->attributes));
2377                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
2378         }
2379         if (ndr_flags & NDR_BUFFERS) {
2380                 if (r->attributes) {
2381                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->num_attributes));
2382                         for (cntr_attributes_1 = 0; cntr_attributes_1 < r->num_attributes; cntr_attributes_1++) {
2383                                 NDR_CHECK(ndr_push_drsuapi_DsReplicaAttribute(ndr, NDR_SCALARS, &r->attributes[cntr_attributes_1]));
2384                         }
2385                         for (cntr_attributes_1 = 0; cntr_attributes_1 < r->num_attributes; cntr_attributes_1++) {
2386                                 NDR_CHECK(ndr_push_drsuapi_DsReplicaAttribute(ndr, NDR_BUFFERS, &r->attributes[cntr_attributes_1]));
2387                         }
2388                 }
2389         }
2390         return NDR_ERR_SUCCESS;
2391 }
2392
2393 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaAttributeCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaAttributeCtr *r)
2394 {
2395         uint32_t _ptr_attributes;
2396         uint32_t cntr_attributes_1;
2397         TALLOC_CTX *_mem_save_attributes_0;
2398         TALLOC_CTX *_mem_save_attributes_1;
2399         if (ndr_flags & NDR_SCALARS) {
2400                 NDR_CHECK(ndr_pull_align(ndr, 5));
2401                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_attributes));
2402                 if (r->num_attributes > 1048576) {
2403                         return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
2404                 }
2405                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_attributes));
2406                 if (_ptr_attributes) {
2407                         NDR_PULL_ALLOC(ndr, r->attributes);
2408                 } else {
2409                         r->attributes = NULL;
2410                 }
2411                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
2412         }
2413         if (ndr_flags & NDR_BUFFERS) {
2414                 if (r->attributes) {
2415                         _mem_save_attributes_0 = NDR_PULL_GET_MEM_CTX(ndr);
2416                         NDR_PULL_SET_MEM_CTX(ndr, r->attributes, 0);
2417                         NDR_CHECK(ndr_pull_array_size(ndr, &r->attributes));
2418                         NDR_PULL_ALLOC_N(ndr, r->attributes, ndr_get_array_size(ndr, &r->attributes));
2419                         _mem_save_attributes_1 = NDR_PULL_GET_MEM_CTX(ndr);
2420                         NDR_PULL_SET_MEM_CTX(ndr, r->attributes, 0);
2421                         for (cntr_attributes_1 = 0; cntr_attributes_1 < r->num_attributes; cntr_attributes_1++) {
2422                                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttribute(ndr, NDR_SCALARS, &r->attributes[cntr_attributes_1]));
2423                         }
2424                         for (cntr_attributes_1 = 0; cntr_attributes_1 < r->num_attributes; cntr_attributes_1++) {
2425                                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttribute(ndr, NDR_BUFFERS, &r->attributes[cntr_attributes_1]));
2426                         }
2427                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attributes_1, 0);
2428                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attributes_0, 0);
2429                 }
2430                 if (r->attributes) {
2431                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->attributes, r->num_attributes));
2432                 }
2433         }
2434         return NDR_ERR_SUCCESS;
2435 }
2436
2437 _PUBLIC_ void ndr_print_drsuapi_DsReplicaAttributeCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaAttributeCtr *r)
2438 {
2439         uint32_t cntr_attributes_1;
2440         ndr_print_struct(ndr, name, "drsuapi_DsReplicaAttributeCtr");
2441         ndr->depth++;
2442         ndr_print_uint32(ndr, "num_attributes", r->num_attributes);
2443         ndr_print_ptr(ndr, "attributes", r->attributes);
2444         ndr->depth++;
2445         if (r->attributes) {
2446                 ndr->print(ndr, "%s: ARRAY(%d)", "attributes", (int)r->num_attributes);
2447                 ndr->depth++;
2448                 for (cntr_attributes_1=0;cntr_attributes_1<r->num_attributes;cntr_attributes_1++) {
2449                         char *idx_1=NULL;
2450                         if (asprintf(&idx_1, "[%d]", cntr_attributes_1) != -1) {
2451                                 ndr_print_drsuapi_DsReplicaAttribute(ndr, "attributes", &r->attributes[cntr_attributes_1]);
2452                                 free(idx_1);
2453                         }
2454                 }
2455                 ndr->depth--;
2456         }
2457         ndr->depth--;
2458         ndr->depth--;
2459 }
2460
2461 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
2462 {
2463         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
2464         return NDR_ERR_SUCCESS;
2465 }
2466
2467 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
2468 {
2469         uint32_t v;
2470         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
2471         *r = v;
2472         return NDR_ERR_SUCCESS;
2473 }
2474
2475 _PUBLIC_ void ndr_print_drsuapi_DsReplicaObjectFlags(struct ndr_print *ndr, const char *name, uint32_t r)
2476 {
2477         ndr_print_uint32(ndr, name, r);
2478         ndr->depth++;
2479         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_OBJECT_FROM_MASTER", DRSUAPI_DS_REPLICA_OBJECT_FROM_MASTER, r);
2480         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_OBJECT_DYNAMIC", DRSUAPI_DS_REPLICA_OBJECT_DYNAMIC, r);
2481         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_OBJECT_REMOTE_MODIFY", DRSUAPI_DS_REPLICA_OBJECT_REMOTE_MODIFY, r);
2482         ndr->depth--;
2483 }
2484
2485 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObject(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObject *r)
2486 {
2487         if (ndr_flags & NDR_SCALARS) {
2488                 NDR_CHECK(ndr_push_align(ndr, 5));
2489                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->identifier));
2490                 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectFlags(ndr, NDR_SCALARS, r->flags));
2491                 NDR_CHECK(ndr_push_drsuapi_DsReplicaAttributeCtr(ndr, NDR_SCALARS, &r->attribute_ctr));
2492                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
2493         }
2494         if (ndr_flags & NDR_BUFFERS) {
2495                 if (r->identifier) {
2496                         NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->identifier));
2497                 }
2498                 NDR_CHECK(ndr_push_drsuapi_DsReplicaAttributeCtr(ndr, NDR_BUFFERS, &r->attribute_ctr));
2499         }
2500         return NDR_ERR_SUCCESS;
2501 }
2502
2503 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaObject(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObject *r)
2504 {
2505         uint32_t _ptr_identifier;
2506         TALLOC_CTX *_mem_save_identifier_0;
2507         if (ndr_flags & NDR_SCALARS) {
2508                 NDR_CHECK(ndr_pull_align(ndr, 5));
2509                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_identifier));
2510                 if (_ptr_identifier) {
2511                         NDR_PULL_ALLOC(ndr, r->identifier);
2512                 } else {
2513                         r->identifier = NULL;
2514                 }
2515                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectFlags(ndr, NDR_SCALARS, &r->flags));
2516                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttributeCtr(ndr, NDR_SCALARS, &r->attribute_ctr));
2517                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
2518         }
2519         if (ndr_flags & NDR_BUFFERS) {
2520                 if (r->identifier) {
2521                         _mem_save_identifier_0 = NDR_PULL_GET_MEM_CTX(ndr);
2522                         NDR_PULL_SET_MEM_CTX(ndr, r->identifier, 0);
2523                         NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->identifier));
2524                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_identifier_0, 0);
2525                 }
2526                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttributeCtr(ndr, NDR_BUFFERS, &r->attribute_ctr));
2527         }
2528         return NDR_ERR_SUCCESS;
2529 }
2530
2531 _PUBLIC_ void ndr_print_drsuapi_DsReplicaObject(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObject *r)
2532 {
2533         ndr_print_struct(ndr, name, "drsuapi_DsReplicaObject");
2534         ndr->depth++;
2535         ndr_print_ptr(ndr, "identifier", r->identifier);
2536         ndr->depth++;
2537         if (r->identifier) {
2538                 ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "identifier", r->identifier);
2539         }
2540         ndr->depth--;
2541         ndr_print_drsuapi_DsReplicaObjectFlags(ndr, "flags", r->flags);
2542         ndr_print_drsuapi_DsReplicaAttributeCtr(ndr, "attribute_ctr", &r->attribute_ctr);
2543         ndr->depth--;
2544 }
2545
2546 static enum ndr_err_code ndr_push_drsuapi_DsReplicaMetaData(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaMetaData *r)
2547 {
2548         if (ndr_flags & NDR_SCALARS) {
2549                 NDR_CHECK(ndr_push_align(ndr, 8));
2550                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version));
2551                 NDR_CHECK(ndr_push_NTTIME_1sec(ndr, NDR_SCALARS, r->originating_change_time));
2552                 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id));
2553                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->originating_usn));
2554                 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
2555         }
2556         if (ndr_flags & NDR_BUFFERS) {
2557         }
2558         return NDR_ERR_SUCCESS;
2559 }
2560
2561 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaMetaData(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaMetaData *r)
2562 {
2563         if (ndr_flags & NDR_SCALARS) {
2564                 NDR_CHECK(ndr_pull_align(ndr, 8));
2565                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
2566                 NDR_CHECK(ndr_pull_NTTIME_1sec(ndr, NDR_SCALARS, &r->originating_change_time));
2567                 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id));
2568                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->originating_usn));
2569                 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
2570         }
2571         if (ndr_flags & NDR_BUFFERS) {
2572         }
2573         return NDR_ERR_SUCCESS;
2574 }
2575
2576 _PUBLIC_ void ndr_print_drsuapi_DsReplicaMetaData(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaMetaData *r)
2577 {
2578         ndr_print_struct(ndr, name, "drsuapi_DsReplicaMetaData");
2579         ndr->depth++;
2580         ndr_print_uint32(ndr, "version", r->version);
2581         ndr_print_NTTIME_1sec(ndr, "originating_change_time", r->originating_change_time);
2582         ndr_print_GUID(ndr, "originating_invocation_id", &r->originating_invocation_id);
2583         ndr_print_hyper(ndr, "originating_usn", r->originating_usn);
2584         ndr->depth--;
2585 }
2586
2587 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaMetaDataCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaMetaDataCtr *r)
2588 {
2589         uint32_t cntr_meta_data_0;
2590         if (ndr_flags & NDR_SCALARS) {
2591                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
2592                 NDR_CHECK(ndr_push_align(ndr, 8));
2593                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
2594                 for (cntr_meta_data_0 = 0; cntr_meta_data_0 < r->count; cntr_meta_data_0++) {
2595                         NDR_CHECK(ndr_push_drsuapi_DsReplicaMetaData(ndr, NDR_SCALARS, &r->meta_data[cntr_meta_data_0]));
2596                 }
2597                 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
2598         }
2599         if (ndr_flags & NDR_BUFFERS) {
2600         }
2601         return NDR_ERR_SUCCESS;
2602 }
2603
2604 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaMetaDataCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaMetaDataCtr *r)
2605 {
2606         uint32_t cntr_meta_data_0;
2607         TALLOC_CTX *_mem_save_meta_data_0;
2608         if (ndr_flags & NDR_SCALARS) {
2609                 NDR_CHECK(ndr_pull_array_size(ndr, &r->meta_data));
2610                 NDR_CHECK(ndr_pull_align(ndr, 8));
2611                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
2612                 if (r->count > 1048576) {
2613                         return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
2614                 }
2615                 NDR_PULL_ALLOC_N(ndr, r->meta_data, ndr_get_array_size(ndr, &r->meta_data));
2616                 _mem_save_meta_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
2617                 NDR_PULL_SET_MEM_CTX(ndr, r->meta_data, 0);
2618                 for (cntr_meta_data_0 = 0; cntr_meta_data_0 < r->count; cntr_meta_data_0++) {
2619                         NDR_CHECK(ndr_pull_drsuapi_DsReplicaMetaData(ndr, NDR_SCALARS, &r->meta_data[cntr_meta_data_0]));
2620                 }
2621                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_meta_data_0, 0);
2622                 if (r->meta_data) {
2623                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->meta_data, r->count));
2624                 }
2625                 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
2626         }
2627         if (ndr_flags & NDR_BUFFERS) {
2628         }
2629         return NDR_ERR_SUCCESS;
2630 }
2631
2632 _PUBLIC_ void ndr_print_drsuapi_DsReplicaMetaDataCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaMetaDataCtr *r)
2633 {
2634         uint32_t cntr_meta_data_0;
2635         ndr_print_struct(ndr, name, "drsuapi_DsReplicaMetaDataCtr");
2636         ndr->depth++;
2637         ndr_print_uint32(ndr, "count", r->count);
2638         ndr->print(ndr, "%s: ARRAY(%d)", "meta_data", (int)r->count);
2639         ndr->depth++;
2640         for (cntr_meta_data_0=0;cntr_meta_data_0<r->count;cntr_meta_data_0++) {
2641                 char *idx_0=NULL;
2642                 if (asprintf(&idx_0, "[%d]", cntr_meta_data_0) != -1) {
2643                         ndr_print_drsuapi_DsReplicaMetaData(ndr, "meta_data", &r->meta_data[cntr_meta_data_0]);
2644                         free(idx_0);
2645                 }
2646         }
2647         ndr->depth--;
2648         ndr->depth--;
2649 }
2650
2651 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectListItemEx(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectListItemEx *r)
2652 {
2653         if (ndr_flags & NDR_SCALARS) {
2654                 NDR_CHECK(ndr_push_align(ndr, 5));
2655                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->next_object));
2656                 NDR_CHECK(ndr_push_drsuapi_DsReplicaObject(ndr, NDR_SCALARS, &r->object));
2657                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_nc_prefix));
2658                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->parent_object_guid));
2659                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->meta_data_ctr));
2660                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
2661         }
2662         if (ndr_flags & NDR_BUFFERS) {
2663                 if (r->next_object) {
2664                         NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectListItemEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->next_object));
2665                 }
2666                 NDR_CHECK(ndr_push_drsuapi_DsReplicaObject(ndr, NDR_BUFFERS, &r->object));
2667                 if (r->parent_object_guid) {
2668                         NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->parent_object_guid));
2669                 }
2670                 if (r->meta_data_ctr) {
2671                         NDR_CHECK(ndr_push_drsuapi_DsReplicaMetaDataCtr(ndr, NDR_SCALARS, r->meta_data_ctr));
2672                 }
2673         }
2674         return NDR_ERR_SUCCESS;
2675 }
2676
2677 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectListItemEx(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectListItemEx *r)
2678 {
2679         uint32_t _ptr_next_object;
2680         TALLOC_CTX *_mem_save_next_object_0;
2681         uint32_t _ptr_parent_object_guid;
2682         TALLOC_CTX *_mem_save_parent_object_guid_0;
2683         uint32_t _ptr_meta_data_ctr;
2684         TALLOC_CTX *_mem_save_meta_data_ctr_0;
2685         if (ndr_flags & NDR_SCALARS) {
2686                 NDR_CHECK(ndr_pull_align(ndr, 5));
2687                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_next_object));
2688                 if (_ptr_next_object) {
2689                         NDR_PULL_ALLOC(ndr, r->next_object);
2690                 } else {
2691                         r->next_object = NULL;
2692                 }
2693                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObject(ndr, NDR_SCALARS, &r->object));
2694                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_nc_prefix));
2695                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_parent_object_guid));
2696                 if (_ptr_parent_object_guid) {
2697                         NDR_PULL_ALLOC(ndr, r->parent_object_guid);
2698                 } else {
2699                         r->parent_object_guid = NULL;
2700                 }
2701                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_meta_data_ctr));
2702                 if (_ptr_meta_data_ctr) {
2703                         NDR_PULL_ALLOC(ndr, r->meta_data_ctr);
2704                 } else {
2705                         r->meta_data_ctr = NULL;
2706                 }
2707                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
2708         }
2709         if (ndr_flags & NDR_BUFFERS) {
2710                 if (r->next_object) {
2711                         _mem_save_next_object_0 = NDR_PULL_GET_MEM_CTX(ndr);
2712                         NDR_PULL_SET_MEM_CTX(ndr, r->next_object, 0);
2713                         NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectListItemEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->next_object));
2714                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_next_object_0, 0);
2715                 }
2716                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObject(ndr, NDR_BUFFERS, &r->object));
2717                 if (r->parent_object_guid) {
2718                         _mem_save_parent_object_guid_0 = NDR_PULL_GET_MEM_CTX(ndr);
2719                         NDR_PULL_SET_MEM_CTX(ndr, r->parent_object_guid, 0);
2720                         NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, r->parent_object_guid));
2721                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parent_object_guid_0, 0);
2722                 }
2723                 if (r->meta_data_ctr) {
2724                         _mem_save_meta_data_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr);
2725                         NDR_PULL_SET_MEM_CTX(ndr, r->meta_data_ctr, 0);
2726                         NDR_CHECK(ndr_pull_drsuapi_DsReplicaMetaDataCtr(ndr, NDR_SCALARS, r->meta_data_ctr));
2727                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_meta_data_ctr_0, 0);
2728                 }
2729         }
2730         return NDR_ERR_SUCCESS;
2731 }
2732
2733 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesCtr1 *r)
2734 {
2735         if (ndr_flags & NDR_SCALARS) {
2736                 NDR_CHECK(ndr_push_align(ndr, 8));
2737                 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_guid));
2738                 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
2739                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->naming_context));
2740                 NDR_CHECK(ndr_push_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->old_highwatermark));
2741                 NDR_CHECK(ndr_push_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->new_highwatermark));
2742                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->uptodateness_vector));
2743                 NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_SCALARS, &r->mapping_ctr));
2744                 NDR_CHECK(ndr_push_drsuapi_DsExtendedError(ndr, NDR_SCALARS, r->extended_ret));
2745                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->object_count));
2746                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_drsuapi_DsGetNCChangesCtr1(r, ndr->iconv_convenience, ndr->flags) + 55));
2747                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->first_object));
2748                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->more_data));
2749                 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
2750         }
2751         if (ndr_flags & NDR_BUFFERS) {
2752                 if (r->naming_context) {
2753                         NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
2754                 }
2755                 if (r->uptodateness_vector) {
2756                         NDR_CHECK(ndr_push_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->uptodateness_vector));
2757                 }
2758                 NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->mapping_ctr));
2759                 if (r->first_object) {
2760                         NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectListItemEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->first_object));
2761                 }
2762         }
2763         return NDR_ERR_SUCCESS;
2764 }
2765
2766 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesCtr1 *r)
2767 {
2768         uint32_t _ptr_naming_context;
2769         TALLOC_CTX *_mem_save_naming_context_0;
2770         uint32_t _ptr_uptodateness_vector;
2771         TALLOC_CTX *_mem_save_uptodateness_vector_0;
2772         uint32_t _ptr_first_object;
2773         TALLOC_CTX *_mem_save_first_object_0;
2774         if (ndr_flags & NDR_SCALARS) {
2775                 NDR_CHECK(ndr_pull_align(ndr, 8));
2776                 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_guid));
2777                 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
2778                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_naming_context));
2779                 if (_ptr_naming_context) {
2780                         NDR_PULL_ALLOC(ndr, r->naming_context);
2781                 } else {
2782                         r->naming_context = NULL;
2783                 }
2784                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->old_highwatermark));
2785                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->new_highwatermark));
2786                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_uptodateness_vector));
2787                 if (_ptr_uptodateness_vector) {
2788                         NDR_PULL_ALLOC(ndr, r->uptodateness_vector);
2789                 } else {
2790                         r->uptodateness_vector = NULL;
2791                 }
2792                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_SCALARS, &r->mapping_ctr));
2793                 NDR_CHECK(ndr_pull_drsuapi_DsExtendedError(ndr, NDR_SCALARS, &r->extended_ret));
2794                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->object_count));
2795                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size));
2796                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_first_object));
2797                 if (_ptr_first_object) {
2798                         NDR_PULL_ALLOC(ndr, r->first_object);
2799                 } else {
2800                         r->first_object = NULL;
2801                 }
2802                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->more_data));
2803                 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
2804         }
2805         if (ndr_flags & NDR_BUFFERS) {
2806                 if (r->naming_context) {
2807                         _mem_save_naming_context_0 = NDR_PULL_GET_MEM_CTX(ndr);
2808                         NDR_PULL_SET_MEM_CTX(ndr, r->naming_context, 0);
2809                         NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
2810                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_naming_context_0, 0);
2811                 }
2812                 if (r->uptodateness_vector) {
2813                         _mem_save_uptodateness_vector_0 = NDR_PULL_GET_MEM_CTX(ndr);
2814                         NDR_PULL_SET_MEM_CTX(ndr, r->uptodateness_vector, 0);
2815                         NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->uptodateness_vector));
2816                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_uptodateness_vector_0, 0);
2817                 }
2818                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->mapping_ctr));
2819                 if (r->first_object) {
2820                         _mem_save_first_object_0 = NDR_PULL_GET_MEM_CTX(ndr);
2821                         NDR_PULL_SET_MEM_CTX(ndr, r->first_object, 0);
2822                         NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectListItemEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->first_object));
2823                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_first_object_0, 0);
2824                 }
2825         }
2826         return NDR_ERR_SUCCESS;
2827 }
2828
2829 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr1 *r)
2830 {
2831         ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesCtr1");
2832         ndr->depth++;
2833         ndr_print_GUID(ndr, "source_dsa_guid", &r->source_dsa_guid);
2834         ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id);
2835         ndr_print_ptr(ndr, "naming_context", r->naming_context);
2836         ndr->depth++;
2837         if (r->naming_context) {
2838                 ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "naming_context", r->naming_context);
2839         }
2840         ndr->depth--;
2841         ndr_print_drsuapi_DsReplicaHighWaterMark(ndr, "old_highwatermark", &r->old_highwatermark);
2842         ndr_print_drsuapi_DsReplicaHighWaterMark(ndr, "new_highwatermark", &r->new_highwatermark);
2843         ndr_print_ptr(ndr, "uptodateness_vector", r->uptodateness_vector);
2844         ndr->depth++;
2845         if (r->uptodateness_vector) {
2846                 ndr_print_drsuapi_DsReplicaCursorCtrEx(ndr, "uptodateness_vector", r->uptodateness_vector);
2847         }
2848         ndr->depth--;
2849         ndr_print_drsuapi_DsReplicaOIDMapping_Ctr(ndr, "mapping_ctr", &r->mapping_ctr);
2850         ndr_print_drsuapi_DsExtendedError(ndr, "extended_ret", r->extended_ret);
2851         ndr_print_uint32(ndr, "object_count", r->object_count);
2852         ndr_print_uint32(ndr, "__ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_drsuapi_DsGetNCChangesCtr1(r, ndr->iconv_convenience, ndr->flags) + 55:r->__ndr_size);
2853         ndr_print_ptr(ndr, "first_object", r->first_object);
2854         ndr->depth++;
2855         if (r->first_object) {
2856                 ndr_print_drsuapi_DsReplicaObjectListItemEx(ndr, "first_object", r->first_object);
2857         }
2858         ndr->depth--;
2859         ndr_print_uint32(ndr, "more_data", r->more_data);
2860         ndr->depth--;
2861 }
2862
2863 _PUBLIC_ size_t ndr_size_drsuapi_DsGetNCChangesCtr1(const struct drsuapi_DsGetNCChangesCtr1 *r, struct smb_iconv_convenience *ic, int flags)
2864 {
2865         return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsGetNCChangesCtr1, ic);
2866 }
2867
2868 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsLinkedAttributeFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
2869 {
2870         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
2871         return NDR_ERR_SUCCESS;
2872 }
2873
2874 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsLinkedAttributeFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
2875 {
2876         uint32_t v;
2877         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
2878         *r = v;
2879         return NDR_ERR_SUCCESS;
2880 }
2881
2882 _PUBLIC_ void ndr_print_drsuapi_DsLinkedAttributeFlags(struct ndr_print *ndr, const char *name, uint32_t r)
2883 {
2884         ndr_print_uint32(ndr, name, r);
2885         ndr->depth++;
2886         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_LINKED_ATTRIBUTE_FLAG_ACTIVE", DRSUAPI_DS_LINKED_ATTRIBUTE_FLAG_ACTIVE, r);
2887         ndr->depth--;
2888 }
2889
2890 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaLinkedAttribute(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaLinkedAttribute *r)
2891 {
2892         if (ndr_flags & NDR_SCALARS) {
2893                 NDR_CHECK(ndr_push_align(ndr, 8));
2894                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->identifier));
2895                 NDR_CHECK(ndr_push_drsuapi_DsAttributeId(ndr, NDR_SCALARS, r->attid));
2896                 NDR_CHECK(ndr_push_drsuapi_DsAttributeValue(ndr, NDR_SCALARS, &r->value));
2897                 NDR_CHECK(ndr_push_drsuapi_DsLinkedAttributeFlags(ndr, NDR_SCALARS, r->flags));
2898                 NDR_CHECK(ndr_push_NTTIME_1sec(ndr, NDR_SCALARS, r->originating_add_time));
2899                 NDR_CHECK(ndr_push_drsuapi_DsReplicaMetaData(ndr, NDR_SCALARS, &r->meta_data));
2900                 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
2901         }
2902         if (ndr_flags & NDR_BUFFERS) {
2903                 if (r->identifier) {
2904                         NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->identifier));
2905                 }
2906                 NDR_CHECK(ndr_push_drsuapi_DsAttributeValue(ndr, NDR_BUFFERS, &r->value));
2907         }
2908         return NDR_ERR_SUCCESS;
2909 }
2910
2911 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaLinkedAttribute(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaLinkedAttribute *r)
2912 {
2913         uint32_t _ptr_identifier;
2914         TALLOC_CTX *_mem_save_identifier_0;
2915         if (ndr_flags & NDR_SCALARS) {
2916                 NDR_CHECK(ndr_pull_align(ndr, 8));
2917                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_identifier));
2918                 if (_ptr_identifier) {
2919                         NDR_PULL_ALLOC(ndr, r->identifier);
2920                 } else {
2921                         r->identifier = NULL;
2922                 }
2923                 NDR_CHECK(ndr_pull_drsuapi_DsAttributeId(ndr, NDR_SCALARS, &r->attid));
2924                 NDR_CHECK(ndr_pull_drsuapi_DsAttributeValue(ndr, NDR_SCALARS, &r->value));
2925                 NDR_CHECK(ndr_pull_drsuapi_DsLinkedAttributeFlags(ndr, NDR_SCALARS, &r->flags));
2926                 NDR_CHECK(ndr_pull_NTTIME_1sec(ndr, NDR_SCALARS, &r->originating_add_time));
2927                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaMetaData(ndr, NDR_SCALARS, &r->meta_data));
2928                 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
2929         }
2930         if (ndr_flags & NDR_BUFFERS) {
2931                 if (r->identifier) {
2932                         _mem_save_identifier_0 = NDR_PULL_GET_MEM_CTX(ndr);
2933                         NDR_PULL_SET_MEM_CTX(ndr, r->identifier, 0);
2934                         NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->identifier));
2935                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_identifier_0, 0);
2936                 }
2937                 NDR_CHECK(ndr_pull_drsuapi_DsAttributeValue(ndr, NDR_BUFFERS, &r->value));
2938         }
2939         return NDR_ERR_SUCCESS;
2940 }
2941
2942 _PUBLIC_ void ndr_print_drsuapi_DsReplicaLinkedAttribute(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaLinkedAttribute *r)
2943 {
2944         ndr_print_struct(ndr, name, "drsuapi_DsReplicaLinkedAttribute");
2945         ndr->depth++;
2946         ndr_print_ptr(ndr, "identifier", r->identifier);
2947         ndr->depth++;
2948         if (r->identifier) {
2949                 ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "identifier", r->identifier);
2950         }
2951         ndr->depth--;
2952         ndr_print_drsuapi_DsAttributeId(ndr, "attid", r->attid);
2953         ndr_print_drsuapi_DsAttributeValue(ndr, "value", &r->value);
2954         ndr_print_drsuapi_DsLinkedAttributeFlags(ndr, "flags", r->flags);
2955         ndr_print_NTTIME_1sec(ndr, "originating_add_time", r->originating_add_time);
2956         ndr_print_drsuapi_DsReplicaMetaData(ndr, "meta_data", &r->meta_data);
2957         ndr->depth--;
2958 }
2959
2960 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr6(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesCtr6 *r)