16388e74691bc76e4fbeb5181f203f76ce9bb303
[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_description: val = "DRSUAPI_ATTRIBUTE_description"; break;
1383                         case DRSUAPI_ATTRIBUTE_member: val = "DRSUAPI_ATTRIBUTE_member"; break;
1384                         case DRSUAPI_ATTRIBUTE_instanceType: val = "DRSUAPI_ATTRIBUTE_instanceType"; break;
1385                         case DRSUAPI_ATTRIBUTE_whenCreated: val = "DRSUAPI_ATTRIBUTE_whenCreated"; break;
1386                         case DRSUAPI_ATTRIBUTE_possSuperiors: val = "DRSUAPI_ATTRIBUTE_possSuperiors"; break;
1387                         case DRSUAPI_ATTRIBUTE_hasMasterNCs: val = "DRSUAPI_ATTRIBUTE_hasMasterNCs"; break;
1388                         case DRSUAPI_ATTRIBUTE_subClassOf: val = "DRSUAPI_ATTRIBUTE_subClassOf"; break;
1389                         case DRSUAPI_ATTRIBUTE_governsID: val = "DRSUAPI_ATTRIBUTE_governsID"; break;
1390                         case DRSUAPI_ATTRIBUTE_mustContain: val = "DRSUAPI_ATTRIBUTE_mustContain"; break;
1391                         case DRSUAPI_ATTRIBUTE_mayContain: val = "DRSUAPI_ATTRIBUTE_mayContain"; break;
1392                         case DRSUAPI_ATTRIBUTE_rDNAttId: val = "DRSUAPI_ATTRIBUTE_rDNAttId"; break;
1393                         case DRSUAPI_ATTRIBUTE_attributeID: val = "DRSUAPI_ATTRIBUTE_attributeID"; break;
1394                         case DRSUAPI_ATTRIBUTE_attributeSyntax: val = "DRSUAPI_ATTRIBUTE_attributeSyntax"; break;
1395                         case DRSUAPI_ATTRIBUTE_isSingleValued: val = "DRSUAPI_ATTRIBUTE_isSingleValued"; break;
1396                         case DRSUAPI_ATTRIBUTE_rangeLower: val = "DRSUAPI_ATTRIBUTE_rangeLower"; break;
1397                         case DRSUAPI_ATTRIBUTE_rangeUpper: val = "DRSUAPI_ATTRIBUTE_rangeUpper"; break;
1398                         case DRSUAPI_ATTRIBUTE_dMDLocation: val = "DRSUAPI_ATTRIBUTE_dMDLocation"; break;
1399                         case DRSUAPI_ATTRIBUTE_objectVersion: val = "DRSUAPI_ATTRIBUTE_objectVersion"; break;
1400                         case DRSUAPI_ATTRIBUTE_invocationId: val = "DRSUAPI_ATTRIBUTE_invocationId"; break;
1401                         case DRSUAPI_ATTRIBUTE_showInAdvancedViewOnly: val = "DRSUAPI_ATTRIBUTE_showInAdvancedViewOnly"; break;
1402                         case DRSUAPI_ATTRIBUTE_adminDisplayName: val = "DRSUAPI_ATTRIBUTE_adminDisplayName"; break;
1403                         case DRSUAPI_ATTRIBUTE_adminDescription: val = "DRSUAPI_ATTRIBUTE_adminDescription"; break;
1404                         case DRSUAPI_ATTRIBUTE_oMSyntax: val = "DRSUAPI_ATTRIBUTE_oMSyntax"; break;
1405                         case DRSUAPI_ATTRIBUTE_ntSecurityDescriptor: val = "DRSUAPI_ATTRIBUTE_ntSecurityDescriptor"; break;
1406                         case DRSUAPI_ATTRIBUTE_searchFlags: val = "DRSUAPI_ATTRIBUTE_searchFlags"; break;
1407                         case DRSUAPI_ATTRIBUTE_auxiliaryClass: val = "DRSUAPI_ATTRIBUTE_auxiliaryClass"; break;
1408                         case DRSUAPI_ATTRIBUTE_lDAPDisplayName: val = "DRSUAPI_ATTRIBUTE_lDAPDisplayName"; break;
1409                         case DRSUAPI_ATTRIBUTE_name: val = "DRSUAPI_ATTRIBUTE_name"; break;
1410                         case DRSUAPI_ATTRIBUTE_userAccountControl: val = "DRSUAPI_ATTRIBUTE_userAccountControl"; break;
1411                         case DRSUAPI_ATTRIBUTE_currentValue: val = "DRSUAPI_ATTRIBUTE_currentValue"; break;
1412                         case DRSUAPI_ATTRIBUTE_homeDirectory: val = "DRSUAPI_ATTRIBUTE_homeDirectory"; break;
1413                         case DRSUAPI_ATTRIBUTE_homeDrive: val = "DRSUAPI_ATTRIBUTE_homeDrive"; break;
1414                         case DRSUAPI_ATTRIBUTE_scriptPath: val = "DRSUAPI_ATTRIBUTE_scriptPath"; break;
1415                         case DRSUAPI_ATTRIBUTE_profilePath: val = "DRSUAPI_ATTRIBUTE_profilePath"; break;
1416                         case DRSUAPI_ATTRIBUTE_objectSid: val = "DRSUAPI_ATTRIBUTE_objectSid"; break;
1417                         case DRSUAPI_ATTRIBUTE_schemaIDGUID: val = "DRSUAPI_ATTRIBUTE_schemaIDGUID"; break;
1418                         case DRSUAPI_ATTRIBUTE_dBCSPwd: val = "DRSUAPI_ATTRIBUTE_dBCSPwd"; break;
1419                         case DRSUAPI_ATTRIBUTE_logonHours: val = "DRSUAPI_ATTRIBUTE_logonHours"; break;
1420                         case DRSUAPI_ATTRIBUTE_userWorkstations: val = "DRSUAPI_ATTRIBUTE_userWorkstations"; break;
1421                         case DRSUAPI_ATTRIBUTE_unicodePwd: val = "DRSUAPI_ATTRIBUTE_unicodePwd"; break;
1422                         case DRSUAPI_ATTRIBUTE_ntPwdHistory: val = "DRSUAPI_ATTRIBUTE_ntPwdHistory"; break;
1423                         case DRSUAPI_ATTRIBUTE_priorValue: val = "DRSUAPI_ATTRIBUTE_priorValue"; break;
1424                         case DRSUAPI_ATTRIBUTE_supplementalCredentials: val = "DRSUAPI_ATTRIBUTE_supplementalCredentials"; break;
1425                         case DRSUAPI_ATTRIBUTE_trustAuthIncoming: val = "DRSUAPI_ATTRIBUTE_trustAuthIncoming"; break;
1426                         case DRSUAPI_ATTRIBUTE_trustAuthOutgoing: val = "DRSUAPI_ATTRIBUTE_trustAuthOutgoing"; break;
1427                         case DRSUAPI_ATTRIBUTE_lmPwdHistory: val = "DRSUAPI_ATTRIBUTE_lmPwdHistory"; break;
1428                         case DRSUAPI_ATTRIBUTE_systemPossSuperiors: val = "DRSUAPI_ATTRIBUTE_systemPossSuperiors"; break;
1429                         case DRSUAPI_ATTRIBUTE_systemMayContain: val = "DRSUAPI_ATTRIBUTE_systemMayContain"; break;
1430                         case DRSUAPI_ATTRIBUTE_systemMustContain: val = "DRSUAPI_ATTRIBUTE_systemMustContain"; break;
1431                         case DRSUAPI_ATTRIBUTE_systemAuxiliaryClass: val = "DRSUAPI_ATTRIBUTE_systemAuxiliaryClass"; break;
1432                         case DRSUAPI_ATTRIBUTE_sAMAccountName: val = "DRSUAPI_ATTRIBUTE_sAMAccountName"; break;
1433                         case DRSUAPI_ATTRIBUTE_sAMAccountType: val = "DRSUAPI_ATTRIBUTE_sAMAccountType"; break;
1434                         case DRSUAPI_ATTRIBUTE_fSMORoleOwner: val = "DRSUAPI_ATTRIBUTE_fSMORoleOwner"; break;
1435                         case DRSUAPI_ATTRIBUTE_systemFlags: val = "DRSUAPI_ATTRIBUTE_systemFlags"; break;
1436                         case DRSUAPI_ATTRIBUTE_serverReference: val = "DRSUAPI_ATTRIBUTE_serverReference"; break;
1437                         case DRSUAPI_ATTRIBUTE_serverReferenceBL: val = "DRSUAPI_ATTRIBUTE_serverReferenceBL"; break;
1438                         case DRSUAPI_ATTRIBUTE_initialAuthIncoming: val = "DRSUAPI_ATTRIBUTE_initialAuthIncoming"; break;
1439                         case DRSUAPI_ATTRIBUTE_initialAuthOutgoing: val = "DRSUAPI_ATTRIBUTE_initialAuthOutgoing"; break;
1440                         case DRSUAPI_ATTRIBUTE_wellKnownObjects: val = "DRSUAPI_ATTRIBUTE_wellKnownObjects"; break;
1441                         case DRSUAPI_ATTRIBUTE_dNSHostName: val = "DRSUAPI_ATTRIBUTE_dNSHostName"; break;
1442                         case DRSUAPI_ATTRIBUTE_isMemberOfPartialAttributeSet: val = "DRSUAPI_ATTRIBUTE_isMemberOfPartialAttributeSet"; break;
1443                         case DRSUAPI_ATTRIBUTE_userPrincipalName: val = "DRSUAPI_ATTRIBUTE_userPrincipalName"; break;
1444                         case DRSUAPI_ATTRIBUTE_groupType: val = "DRSUAPI_ATTRIBUTE_groupType"; break;
1445                         case DRSUAPI_ATTRIBUTE_servicePrincipalName: val = "DRSUAPI_ATTRIBUTE_servicePrincipalName"; break;
1446                         case DRSUAPI_ATTRIBUTE_objectCategory: val = "DRSUAPI_ATTRIBUTE_objectCategory"; break;
1447                         case DRSUAPI_ATTRIBUTE_gPLink: val = "DRSUAPI_ATTRIBUTE_gPLink"; break;
1448                         case DRSUAPI_ATTRIBUTE_transportAddressAttribute: val = "DRSUAPI_ATTRIBUTE_transportAddressAttribute"; break;
1449                         case DRSUAPI_ATTRIBUTE_msDS_Behavior_Version: val = "DRSUAPI_ATTRIBUTE_msDS_Behavior_Version"; break;
1450                         case DRSUAPI_ATTRIBUTE_msDS_KeyVersionNumber: val = "DRSUAPI_ATTRIBUTE_msDS_KeyVersionNumber"; break;
1451                         case DRSUAPI_ATTRIBUTE_msDS_HasDomainNCs: val = "DRSUAPI_ATTRIBUTE_msDS_HasDomainNCs"; break;
1452                         case DRSUAPI_ATTRIBUTE_msDS_hasMasterNCs: val = "DRSUAPI_ATTRIBUTE_msDS_hasMasterNCs"; break;
1453                 }
1454                 ndr_print_enum(ndr, name, "ENUM", val, r);
1455                 ndr->flags = _flags_save_ENUM;
1456         }
1457 }
1458
1459 static enum ndr_err_code ndr_push_drsuapi_DsPartialAttributeSet(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsPartialAttributeSet *r)
1460 {
1461         uint32_t cntr_attids_0;
1462         if (ndr_flags & NDR_SCALARS) {
1463                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->num_attids));
1464                 NDR_CHECK(ndr_push_align(ndr, 4));
1465                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 1));
1466                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
1467                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_attids));
1468                 for (cntr_attids_0 = 0; cntr_attids_0 < r->num_attids; cntr_attids_0++) {
1469                         NDR_CHECK(ndr_push_drsuapi_DsAttributeId(ndr, NDR_SCALARS, r->attids[cntr_attids_0]));
1470                 }
1471                 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
1472         }
1473         if (ndr_flags & NDR_BUFFERS) {
1474         }
1475         return NDR_ERR_SUCCESS;
1476 }
1477
1478 static enum ndr_err_code ndr_pull_drsuapi_DsPartialAttributeSet(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsPartialAttributeSet *r)
1479 {
1480         uint32_t cntr_attids_0;
1481         TALLOC_CTX *_mem_save_attids_0;
1482         if (ndr_flags & NDR_SCALARS) {
1483                 NDR_CHECK(ndr_pull_array_size(ndr, &r->attids));
1484                 NDR_CHECK(ndr_pull_align(ndr, 4));
1485                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
1486                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved1));
1487                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_attids));
1488                 if (r->num_attids < 1 || r->num_attids > 0x100000) {
1489                         return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
1490                 }
1491                 NDR_PULL_ALLOC_N(ndr, r->attids, ndr_get_array_size(ndr, &r->attids));
1492                 _mem_save_attids_0 = NDR_PULL_GET_MEM_CTX(ndr);
1493                 NDR_PULL_SET_MEM_CTX(ndr, r->attids, 0);
1494                 for (cntr_attids_0 = 0; cntr_attids_0 < r->num_attids; cntr_attids_0++) {
1495                         NDR_CHECK(ndr_pull_drsuapi_DsAttributeId(ndr, NDR_SCALARS, &r->attids[cntr_attids_0]));
1496                 }
1497                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attids_0, 0);
1498                 if (r->attids) {
1499                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->attids, r->num_attids));
1500                 }
1501                 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
1502         }
1503         if (ndr_flags & NDR_BUFFERS) {
1504         }
1505         return NDR_ERR_SUCCESS;
1506 }
1507
1508 _PUBLIC_ void ndr_print_drsuapi_DsPartialAttributeSet(struct ndr_print *ndr, const char *name, const struct drsuapi_DsPartialAttributeSet *r)
1509 {
1510         uint32_t cntr_attids_0;
1511         ndr_print_struct(ndr, name, "drsuapi_DsPartialAttributeSet");
1512         ndr->depth++;
1513         ndr_print_uint32(ndr, "version", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?1:r->version);
1514         ndr_print_uint32(ndr, "reserved1", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved1);
1515         ndr_print_uint32(ndr, "num_attids", r->num_attids);
1516         ndr->print(ndr, "%s: ARRAY(%d)", "attids", (int)r->num_attids);
1517         ndr->depth++;
1518         for (cntr_attids_0=0;cntr_attids_0<r->num_attids;cntr_attids_0++) {
1519                 char *idx_0=NULL;
1520                 if (asprintf(&idx_0, "[%d]", cntr_attids_0) != -1) {
1521                         ndr_print_drsuapi_DsAttributeId(ndr, "attids", r->attids[cntr_attids_0]);
1522                         free(idx_0);
1523                 }
1524         }
1525         ndr->depth--;
1526         ndr->depth--;
1527 }
1528
1529 static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesRequest8(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesRequest8 *r)
1530 {
1531         if (ndr_flags & NDR_SCALARS) {
1532                 NDR_CHECK(ndr_push_align(ndr, 8));
1533                 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->destination_dsa_guid));
1534                 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
1535                 if (r->naming_context == NULL) {
1536                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1537                 }
1538                 NDR_CHECK(ndr_push_ref_ptr(ndr));
1539                 NDR_CHECK(ndr_push_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->highwatermark));
1540                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->uptodateness_vector));
1541                 NDR_CHECK(ndr_push_drsuapi_DsReplicaNeighbourFlags(ndr, NDR_SCALARS, r->replica_flags));
1542                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_object_count));
1543                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_ndr_size));
1544                 NDR_CHECK(ndr_push_drsuapi_DsExtendedOperation(ndr, NDR_SCALARS, r->extended_op));
1545                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->fsmo_info));
1546                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->partial_attribute_set));
1547                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->partial_attribute_set_ex));
1548                 NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_SCALARS, &r->mapping_ctr));
1549                 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
1550         }
1551         if (ndr_flags & NDR_BUFFERS) {
1552                 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
1553                 if (r->uptodateness_vector) {
1554                         NDR_CHECK(ndr_push_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->uptodateness_vector));
1555                 }
1556                 if (r->partial_attribute_set) {
1557                         NDR_CHECK(ndr_push_drsuapi_DsPartialAttributeSet(ndr, NDR_SCALARS, r->partial_attribute_set));
1558                 }
1559                 if (r->partial_attribute_set_ex) {
1560                         NDR_CHECK(ndr_push_drsuapi_DsPartialAttributeSet(ndr, NDR_SCALARS, r->partial_attribute_set_ex));
1561                 }
1562                 NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->mapping_ctr));
1563         }
1564         return NDR_ERR_SUCCESS;
1565 }
1566
1567 static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesRequest8(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesRequest8 *r)
1568 {
1569         uint32_t _ptr_naming_context;
1570         TALLOC_CTX *_mem_save_naming_context_0;
1571         uint32_t _ptr_uptodateness_vector;
1572         TALLOC_CTX *_mem_save_uptodateness_vector_0;
1573         uint32_t _ptr_partial_attribute_set;
1574         TALLOC_CTX *_mem_save_partial_attribute_set_0;
1575         uint32_t _ptr_partial_attribute_set_ex;
1576         TALLOC_CTX *_mem_save_partial_attribute_set_ex_0;
1577         if (ndr_flags & NDR_SCALARS) {
1578                 NDR_CHECK(ndr_pull_align(ndr, 8));
1579                 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->destination_dsa_guid));
1580                 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
1581                 NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_naming_context));
1582                 if (_ptr_naming_context) {
1583                         NDR_PULL_ALLOC(ndr, r->naming_context);
1584                 } else {
1585                         r->naming_context = NULL;
1586                 }
1587                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->highwatermark));
1588                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_uptodateness_vector));
1589                 if (_ptr_uptodateness_vector) {
1590                         NDR_PULL_ALLOC(ndr, r->uptodateness_vector);
1591                 } else {
1592                         r->uptodateness_vector = NULL;
1593                 }
1594                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaNeighbourFlags(ndr, NDR_SCALARS, &r->replica_flags));
1595                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_object_count));
1596                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_ndr_size));
1597                 NDR_CHECK(ndr_pull_drsuapi_DsExtendedOperation(ndr, NDR_SCALARS, &r->extended_op));
1598                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->fsmo_info));
1599                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_partial_attribute_set));
1600                 if (_ptr_partial_attribute_set) {
1601                         NDR_PULL_ALLOC(ndr, r->partial_attribute_set);
1602                 } else {
1603                         r->partial_attribute_set = NULL;
1604                 }
1605                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_partial_attribute_set_ex));
1606                 if (_ptr_partial_attribute_set_ex) {
1607                         NDR_PULL_ALLOC(ndr, r->partial_attribute_set_ex);
1608                 } else {
1609                         r->partial_attribute_set_ex = NULL;
1610                 }
1611                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_SCALARS, &r->mapping_ctr));
1612                 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
1613         }
1614         if (ndr_flags & NDR_BUFFERS) {
1615                 _mem_save_naming_context_0 = NDR_PULL_GET_MEM_CTX(ndr);
1616                 NDR_PULL_SET_MEM_CTX(ndr, r->naming_context, 0);
1617                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
1618                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_naming_context_0, 0);
1619                 if (r->uptodateness_vector) {
1620                         _mem_save_uptodateness_vector_0 = NDR_PULL_GET_MEM_CTX(ndr);
1621                         NDR_PULL_SET_MEM_CTX(ndr, r->uptodateness_vector, 0);
1622                         NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->uptodateness_vector));
1623                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_uptodateness_vector_0, 0);
1624                 }
1625                 if (r->partial_attribute_set) {
1626                         _mem_save_partial_attribute_set_0 = NDR_PULL_GET_MEM_CTX(ndr);
1627                         NDR_PULL_SET_MEM_CTX(ndr, r->partial_attribute_set, 0);
1628                         NDR_CHECK(ndr_pull_drsuapi_DsPartialAttributeSet(ndr, NDR_SCALARS, r->partial_attribute_set));
1629                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_partial_attribute_set_0, 0);
1630                 }
1631                 if (r->partial_attribute_set_ex) {
1632                         _mem_save_partial_attribute_set_ex_0 = NDR_PULL_GET_MEM_CTX(ndr);
1633                         NDR_PULL_SET_MEM_CTX(ndr, r->partial_attribute_set_ex, 0);
1634                         NDR_CHECK(ndr_pull_drsuapi_DsPartialAttributeSet(ndr, NDR_SCALARS, r->partial_attribute_set_ex));
1635                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_partial_attribute_set_ex_0, 0);
1636                 }
1637                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->mapping_ctr));
1638         }
1639         return NDR_ERR_SUCCESS;
1640 }
1641
1642 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesRequest8(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesRequest8 *r)
1643 {
1644         ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesRequest8");
1645         ndr->depth++;
1646         ndr_print_GUID(ndr, "destination_dsa_guid", &r->destination_dsa_guid);
1647         ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id);
1648         ndr_print_ptr(ndr, "naming_context", r->naming_context);
1649         ndr->depth++;
1650         ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "naming_context", r->naming_context);
1651         ndr->depth--;
1652         ndr_print_drsuapi_DsReplicaHighWaterMark(ndr, "highwatermark", &r->highwatermark);
1653         ndr_print_ptr(ndr, "uptodateness_vector", r->uptodateness_vector);
1654         ndr->depth++;
1655         if (r->uptodateness_vector) {
1656                 ndr_print_drsuapi_DsReplicaCursorCtrEx(ndr, "uptodateness_vector", r->uptodateness_vector);
1657         }
1658         ndr->depth--;
1659         ndr_print_drsuapi_DsReplicaNeighbourFlags(ndr, "replica_flags", r->replica_flags);
1660         ndr_print_uint32(ndr, "max_object_count", r->max_object_count);
1661         ndr_print_uint32(ndr, "max_ndr_size", r->max_ndr_size);
1662         ndr_print_drsuapi_DsExtendedOperation(ndr, "extended_op", r->extended_op);
1663         ndr_print_hyper(ndr, "fsmo_info", r->fsmo_info);
1664         ndr_print_ptr(ndr, "partial_attribute_set", r->partial_attribute_set);
1665         ndr->depth++;
1666         if (r->partial_attribute_set) {
1667                 ndr_print_drsuapi_DsPartialAttributeSet(ndr, "partial_attribute_set", r->partial_attribute_set);
1668         }
1669         ndr->depth--;
1670         ndr_print_ptr(ndr, "partial_attribute_set_ex", r->partial_attribute_set_ex);
1671         ndr->depth++;
1672         if (r->partial_attribute_set_ex) {
1673                 ndr_print_drsuapi_DsPartialAttributeSet(ndr, "partial_attribute_set_ex", r->partial_attribute_set_ex);
1674         }
1675         ndr->depth--;
1676         ndr_print_drsuapi_DsReplicaOIDMapping_Ctr(ndr, "mapping_ctr", &r->mapping_ctr);
1677         ndr->depth--;
1678 }
1679
1680 static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesRequest10(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesRequest10 *r)
1681 {
1682         if (ndr_flags & NDR_SCALARS) {
1683                 NDR_CHECK(ndr_push_align(ndr, 8));
1684                 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->destination_dsa_guid));
1685                 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
1686                 if (r->naming_context == NULL) {
1687                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1688                 }
1689                 NDR_CHECK(ndr_push_ref_ptr(ndr));
1690                 NDR_CHECK(ndr_push_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->highwatermark));
1691                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->uptodateness_vector));
1692                 NDR_CHECK(ndr_push_drsuapi_DsReplicaNeighbourFlags(ndr, NDR_SCALARS, r->replica_flags));
1693                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_object_count));
1694                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_ndr_size));
1695                 NDR_CHECK(ndr_push_drsuapi_DsExtendedOperation(ndr, NDR_SCALARS, r->extended_op));
1696                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->fsmo_info));
1697                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->partial_attribute_set));
1698                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->partial_attribute_set_ex));
1699                 NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_SCALARS, &r->mapping_ctr));
1700                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->more_flags));
1701                 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
1702         }
1703         if (ndr_flags & NDR_BUFFERS) {
1704                 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
1705                 if (r->uptodateness_vector) {
1706                         NDR_CHECK(ndr_push_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->uptodateness_vector));
1707                 }
1708                 if (r->partial_attribute_set) {
1709                         NDR_CHECK(ndr_push_drsuapi_DsPartialAttributeSet(ndr, NDR_SCALARS, r->partial_attribute_set));
1710                 }
1711                 if (r->partial_attribute_set_ex) {
1712                         NDR_CHECK(ndr_push_drsuapi_DsPartialAttributeSet(ndr, NDR_SCALARS, r->partial_attribute_set_ex));
1713                 }
1714                 NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->mapping_ctr));
1715         }
1716         return NDR_ERR_SUCCESS;
1717 }
1718
1719 static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesRequest10(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesRequest10 *r)
1720 {
1721         uint32_t _ptr_naming_context;
1722         TALLOC_CTX *_mem_save_naming_context_0;
1723         uint32_t _ptr_uptodateness_vector;
1724         TALLOC_CTX *_mem_save_uptodateness_vector_0;
1725         uint32_t _ptr_partial_attribute_set;
1726         TALLOC_CTX *_mem_save_partial_attribute_set_0;
1727         uint32_t _ptr_partial_attribute_set_ex;
1728         TALLOC_CTX *_mem_save_partial_attribute_set_ex_0;
1729         if (ndr_flags & NDR_SCALARS) {
1730                 NDR_CHECK(ndr_pull_align(ndr, 8));
1731                 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->destination_dsa_guid));
1732                 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
1733                 NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_naming_context));
1734                 if (_ptr_naming_context) {
1735                         NDR_PULL_ALLOC(ndr, r->naming_context);
1736                 } else {
1737                         r->naming_context = NULL;
1738                 }
1739                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->highwatermark));
1740                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_uptodateness_vector));
1741                 if (_ptr_uptodateness_vector) {
1742                         NDR_PULL_ALLOC(ndr, r->uptodateness_vector);
1743                 } else {
1744                         r->uptodateness_vector = NULL;
1745                 }
1746                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaNeighbourFlags(ndr, NDR_SCALARS, &r->replica_flags));
1747                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_object_count));
1748                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_ndr_size));
1749                 NDR_CHECK(ndr_pull_drsuapi_DsExtendedOperation(ndr, NDR_SCALARS, &r->extended_op));
1750                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->fsmo_info));
1751                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_partial_attribute_set));
1752                 if (_ptr_partial_attribute_set) {
1753                         NDR_PULL_ALLOC(ndr, r->partial_attribute_set);
1754                 } else {
1755                         r->partial_attribute_set = NULL;
1756                 }
1757                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_partial_attribute_set_ex));
1758                 if (_ptr_partial_attribute_set_ex) {
1759                         NDR_PULL_ALLOC(ndr, r->partial_attribute_set_ex);
1760                 } else {
1761                         r->partial_attribute_set_ex = NULL;
1762                 }
1763                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_SCALARS, &r->mapping_ctr));
1764                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->more_flags));
1765                 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
1766         }
1767         if (ndr_flags & NDR_BUFFERS) {
1768                 _mem_save_naming_context_0 = NDR_PULL_GET_MEM_CTX(ndr);
1769                 NDR_PULL_SET_MEM_CTX(ndr, r->naming_context, 0);
1770                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
1771                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_naming_context_0, 0);
1772                 if (r->uptodateness_vector) {
1773                         _mem_save_uptodateness_vector_0 = NDR_PULL_GET_MEM_CTX(ndr);
1774                         NDR_PULL_SET_MEM_CTX(ndr, r->uptodateness_vector, 0);
1775                         NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->uptodateness_vector));
1776                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_uptodateness_vector_0, 0);
1777                 }
1778                 if (r->partial_attribute_set) {
1779                         _mem_save_partial_attribute_set_0 = NDR_PULL_GET_MEM_CTX(ndr);
1780                         NDR_PULL_SET_MEM_CTX(ndr, r->partial_attribute_set, 0);
1781                         NDR_CHECK(ndr_pull_drsuapi_DsPartialAttributeSet(ndr, NDR_SCALARS, r->partial_attribute_set));
1782                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_partial_attribute_set_0, 0);
1783                 }
1784                 if (r->partial_attribute_set_ex) {
1785                         _mem_save_partial_attribute_set_ex_0 = NDR_PULL_GET_MEM_CTX(ndr);
1786                         NDR_PULL_SET_MEM_CTX(ndr, r->partial_attribute_set_ex, 0);
1787                         NDR_CHECK(ndr_pull_drsuapi_DsPartialAttributeSet(ndr, NDR_SCALARS, r->partial_attribute_set_ex));
1788                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_partial_attribute_set_ex_0, 0);
1789                 }
1790                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->mapping_ctr));
1791         }
1792         return NDR_ERR_SUCCESS;
1793 }
1794
1795 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesRequest10(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesRequest10 *r)
1796 {
1797         ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesRequest10");
1798         ndr->depth++;
1799         ndr_print_GUID(ndr, "destination_dsa_guid", &r->destination_dsa_guid);
1800         ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id);
1801         ndr_print_ptr(ndr, "naming_context", r->naming_context);
1802         ndr->depth++;
1803         ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "naming_context", r->naming_context);
1804         ndr->depth--;
1805         ndr_print_drsuapi_DsReplicaHighWaterMark(ndr, "highwatermark", &r->highwatermark);
1806         ndr_print_ptr(ndr, "uptodateness_vector", r->uptodateness_vector);
1807         ndr->depth++;
1808         if (r->uptodateness_vector) {
1809                 ndr_print_drsuapi_DsReplicaCursorCtrEx(ndr, "uptodateness_vector", r->uptodateness_vector);
1810         }
1811         ndr->depth--;
1812         ndr_print_drsuapi_DsReplicaNeighbourFlags(ndr, "replica_flags", r->replica_flags);
1813         ndr_print_uint32(ndr, "max_object_count", r->max_object_count);
1814         ndr_print_uint32(ndr, "max_ndr_size", r->max_ndr_size);
1815         ndr_print_drsuapi_DsExtendedOperation(ndr, "extended_op", r->extended_op);
1816         ndr_print_hyper(ndr, "fsmo_info", r->fsmo_info);
1817         ndr_print_ptr(ndr, "partial_attribute_set", r->partial_attribute_set);
1818         ndr->depth++;
1819         if (r->partial_attribute_set) {
1820                 ndr_print_drsuapi_DsPartialAttributeSet(ndr, "partial_attribute_set", r->partial_attribute_set);
1821         }
1822         ndr->depth--;
1823         ndr_print_ptr(ndr, "partial_attribute_set_ex", r->partial_attribute_set_ex);
1824         ndr->depth++;
1825         if (r->partial_attribute_set_ex) {
1826                 ndr_print_drsuapi_DsPartialAttributeSet(ndr, "partial_attribute_set_ex", r->partial_attribute_set_ex);
1827         }
1828         ndr->depth--;
1829         ndr_print_drsuapi_DsReplicaOIDMapping_Ctr(ndr, "mapping_ctr", &r->mapping_ctr);
1830         ndr_print_uint32(ndr, "more_flags", r->more_flags);
1831         ndr->depth--;
1832 }
1833
1834 static enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesRequest(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsGetNCChangesRequest *r)
1835 {
1836         if (ndr_flags & NDR_SCALARS) {
1837                 int level = ndr_push_get_switch_value(ndr, r);
1838                 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, level));
1839                 NDR_CHECK(ndr_push_union_align(ndr, 8));
1840                 switch (level) {
1841                         case 5: {
1842                                 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesRequest5(ndr, NDR_SCALARS, &r->req5));
1843                         break; }
1844
1845                         case 8: {
1846                                 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesRequest8(ndr, NDR_SCALARS, &r->req8));
1847                         break; }
1848
1849                         case 10: {
1850                                 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesRequest10(ndr, NDR_SCALARS, &r->req10));
1851                         break; }
1852
1853                         default:
1854                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1855                 }
1856         }
1857         if (ndr_flags & NDR_BUFFERS) {
1858                 int level = ndr_push_get_switch_value(ndr, r);
1859                 switch (level) {
1860                         case 5:
1861                                 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesRequest5(ndr, NDR_BUFFERS, &r->req5));
1862                         break;
1863
1864                         case 8:
1865                                 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesRequest8(ndr, NDR_BUFFERS, &r->req8));
1866                         break;
1867
1868                         case 10:
1869                                 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesRequest10(ndr, NDR_BUFFERS, &r->req10));
1870                         break;
1871
1872                         default:
1873                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1874                 }
1875         }
1876         return NDR_ERR_SUCCESS;
1877 }
1878
1879 static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesRequest(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsGetNCChangesRequest *r)
1880 {
1881         int level;
1882         int32_t _level;
1883         level = ndr_pull_get_switch_value(ndr, r);
1884         if (ndr_flags & NDR_SCALARS) {
1885                 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &_level));
1886                 if (_level != level) {
1887                         return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
1888                 }
1889                 NDR_CHECK(ndr_pull_union_align(ndr, 8));
1890                 switch (level) {
1891                         case 5: {
1892                                 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesRequest5(ndr, NDR_SCALARS, &r->req5));
1893                         break; }
1894
1895                         case 8: {
1896                                 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesRequest8(ndr, NDR_SCALARS, &r->req8));
1897                         break; }
1898
1899                         case 10: {
1900                                 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesRequest10(ndr, NDR_SCALARS, &r->req10));
1901                         break; }
1902
1903                         default:
1904                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1905                 }
1906         }
1907         if (ndr_flags & NDR_BUFFERS) {
1908                 switch (level) {
1909                         case 5:
1910                                 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesRequest5(ndr, NDR_BUFFERS, &r->req5));
1911                         break;
1912
1913                         case 8:
1914                                 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesRequest8(ndr, NDR_BUFFERS, &r->req8));
1915                         break;
1916
1917                         case 10:
1918                                 NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesRequest10(ndr, NDR_BUFFERS, &r->req10));
1919                         break;
1920
1921                         default:
1922                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1923                 }
1924         }
1925         return NDR_ERR_SUCCESS;
1926 }
1927
1928 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetNCChangesRequest *r)
1929 {
1930         int level;
1931         level = ndr_print_get_switch_value(ndr, r);
1932         ndr_print_union(ndr, name, level, "drsuapi_DsGetNCChangesRequest");
1933         switch (level) {
1934                 case 5:
1935                         ndr_print_drsuapi_DsGetNCChangesRequest5(ndr, "req5", &r->req5);
1936                 break;
1937
1938                 case 8:
1939                         ndr_print_drsuapi_DsGetNCChangesRequest8(ndr, "req8", &r->req8);
1940                 break;
1941
1942                 case 10:
1943                         ndr_print_drsuapi_DsGetNCChangesRequest10(ndr, "req10", &r->req10);
1944                 break;
1945
1946                 default:
1947                         ndr_print_bad_level(ndr, name, level);
1948         }
1949 }
1950
1951 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaCursor2(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursor2 *r)
1952 {
1953         if (ndr_flags & NDR_SCALARS) {
1954                 NDR_CHECK(ndr_push_align(ndr, 8));
1955                 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
1956                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->highest_usn));
1957                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_sync_success));
1958                 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
1959         }
1960         if (ndr_flags & NDR_BUFFERS) {
1961         }
1962         return NDR_ERR_SUCCESS;
1963 }
1964
1965 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursor2(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursor2 *r)
1966 {
1967         if (ndr_flags & NDR_SCALARS) {
1968                 NDR_CHECK(ndr_pull_align(ndr, 8));
1969                 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
1970                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->highest_usn));
1971                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_sync_success));
1972                 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
1973         }
1974         if (ndr_flags & NDR_BUFFERS) {
1975         }
1976         return NDR_ERR_SUCCESS;
1977 }
1978
1979 _PUBLIC_ void ndr_print_drsuapi_DsReplicaCursor2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursor2 *r)
1980 {
1981         ndr_print_struct(ndr, name, "drsuapi_DsReplicaCursor2");
1982         ndr->depth++;
1983         ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id);
1984         ndr_print_hyper(ndr, "highest_usn", r->highest_usn);
1985         ndr_print_NTTIME(ndr, "last_sync_success", r->last_sync_success);
1986         ndr->depth--;
1987 }
1988
1989 static enum ndr_err_code ndr_push_drsuapi_DsReplicaCursor2CtrEx(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaCursor2CtrEx *r)
1990 {
1991         uint32_t cntr_cursors_0;
1992         if (ndr_flags & NDR_SCALARS) {
1993                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
1994                 NDR_CHECK(ndr_push_align(ndr, 8));
1995                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 2));
1996                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
1997                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
1998                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
1999                 for (cntr_cursors_0 = 0; cntr_cursors_0 < r->count; cntr_cursors_0++) {
2000                         NDR_CHECK(ndr_push_drsuapi_DsReplicaCursor2(ndr, NDR_SCALARS, &r->cursors[cntr_cursors_0]));
2001                 }
2002                 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
2003         }
2004         if (ndr_flags & NDR_BUFFERS) {
2005         }
2006         return NDR_ERR_SUCCESS;
2007 }
2008
2009 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaCursor2CtrEx(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaCursor2CtrEx *r)
2010 {
2011         uint32_t cntr_cursors_0;
2012         TALLOC_CTX *_mem_save_cursors_0;
2013         if (ndr_flags & NDR_SCALARS) {
2014                 NDR_CHECK(ndr_pull_array_size(ndr, &r->cursors));
2015                 NDR_CHECK(ndr_pull_align(ndr, 8));
2016                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
2017                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved1));
2018                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
2019                 if (r->count > 0x100000) {
2020                         return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
2021                 }
2022                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved2));
2023                 NDR_PULL_ALLOC_N(ndr, r->cursors, ndr_get_array_size(ndr, &r->cursors));
2024                 _mem_save_cursors_0 = NDR_PULL_GET_MEM_CTX(ndr);
2025                 NDR_PULL_SET_MEM_CTX(ndr, r->cursors, 0);
2026                 for (cntr_cursors_0 = 0; cntr_cursors_0 < r->count; cntr_cursors_0++) {
2027                         NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursor2(ndr, NDR_SCALARS, &r->cursors[cntr_cursors_0]));
2028                 }
2029                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_cursors_0, 0);
2030                 if (r->cursors) {
2031                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->cursors, r->count));
2032                 }
2033                 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
2034         }
2035         if (ndr_flags & NDR_BUFFERS) {
2036         }
2037         return NDR_ERR_SUCCESS;
2038 }
2039
2040 _PUBLIC_ void ndr_print_drsuapi_DsReplicaCursor2CtrEx(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursor2CtrEx *r)
2041 {
2042         uint32_t cntr_cursors_0;
2043         ndr_print_struct(ndr, name, "drsuapi_DsReplicaCursor2CtrEx");
2044         ndr->depth++;
2045         ndr_print_uint32(ndr, "version", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?2:r->version);
2046         ndr_print_uint32(ndr, "reserved1", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved1);
2047         ndr_print_uint32(ndr, "count", r->count);
2048         ndr_print_uint32(ndr, "reserved2", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved2);
2049         ndr->print(ndr, "%s: ARRAY(%d)", "cursors", (int)r->count);
2050         ndr->depth++;
2051         for (cntr_cursors_0=0;cntr_cursors_0<r->count;cntr_cursors_0++) {
2052                 char *idx_0=NULL;
2053                 if (asprintf(&idx_0, "[%d]", cntr_cursors_0) != -1) {
2054                         ndr_print_drsuapi_DsReplicaCursor2(ndr, "cursors", &r->cursors[cntr_cursors_0]);
2055                         free(idx_0);
2056                 }
2057         }
2058         ndr->depth--;
2059         ndr->depth--;
2060 }
2061
2062 static enum ndr_err_code ndr_push_drsuapi_DsAttributeValue(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAttributeValue *r)
2063 {
2064         if (ndr_flags & NDR_SCALARS) {
2065                 NDR_CHECK(ndr_push_align(ndr, 5));
2066                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_DATA_BLOB(0, r->blob, 0)));
2067                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->blob));
2068                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
2069         }
2070         if (ndr_flags & NDR_BUFFERS) {
2071                 if (r->blob) {
2072                         NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, *r->blob));
2073                 }
2074         }
2075         return NDR_ERR_SUCCESS;
2076 }
2077
2078 static enum ndr_err_code ndr_pull_drsuapi_DsAttributeValue(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAttributeValue *r)
2079 {
2080         uint32_t _ptr_blob;
2081         TALLOC_CTX *_mem_save_blob_0;
2082         if (ndr_flags & NDR_SCALARS) {
2083                 NDR_CHECK(ndr_pull_align(ndr, 5));
2084                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size));
2085                 if (r->__ndr_size > 10485760) {
2086                         return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
2087                 }
2088                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_blob));
2089                 if (_ptr_blob) {
2090                         NDR_PULL_ALLOC(ndr, r->blob);
2091                 } else {
2092                         r->blob = NULL;
2093                 }
2094                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
2095         }
2096         if (ndr_flags & NDR_BUFFERS) {
2097                 if (r->blob) {
2098                         _mem_save_blob_0 = NDR_PULL_GET_MEM_CTX(ndr);
2099                         NDR_PULL_SET_MEM_CTX(ndr, r->blob, 0);
2100                         NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, r->blob));
2101                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_blob_0, 0);
2102                 }
2103         }
2104         return NDR_ERR_SUCCESS;
2105 }
2106
2107 _PUBLIC_ void ndr_print_drsuapi_DsAttributeValue(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAttributeValue *r)
2108 {
2109         ndr_print_struct(ndr, name, "drsuapi_DsAttributeValue");
2110         ndr->depth++;
2111         ndr_print_uint32(ndr, "__ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_DATA_BLOB(0, r->blob, 0):r->__ndr_size);
2112         ndr_print_ptr(ndr, "blob", r->blob);
2113         ndr->depth++;
2114         if (r->blob) {
2115                 ndr_print_DATA_BLOB(ndr, "blob", *r->blob);
2116         }
2117         ndr->depth--;
2118         ndr->depth--;
2119 }
2120
2121 static enum ndr_err_code ndr_push_drsuapi_DsAttributeValueCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsAttributeValueCtr *r)
2122 {
2123         uint32_t cntr_values_1;
2124         if (ndr_flags & NDR_SCALARS) {
2125                 NDR_CHECK(ndr_push_align(ndr, 5));
2126                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_values));
2127                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->values));
2128                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
2129         }
2130         if (ndr_flags & NDR_BUFFERS) {
2131                 if (r->values) {
2132                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->num_values));
2133                         for (cntr_values_1 = 0; cntr_values_1 < r->num_values; cntr_values_1++) {
2134                                 NDR_CHECK(ndr_push_drsuapi_DsAttributeValue(ndr, NDR_SCALARS, &r->values[cntr_values_1]));
2135                         }
2136                         for (cntr_values_1 = 0; cntr_values_1 < r->num_values; cntr_values_1++) {
2137                                 NDR_CHECK(ndr_push_drsuapi_DsAttributeValue(ndr, NDR_BUFFERS, &r->values[cntr_values_1]));
2138                         }
2139                 }
2140         }
2141         return NDR_ERR_SUCCESS;
2142 }
2143
2144 static enum ndr_err_code ndr_pull_drsuapi_DsAttributeValueCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsAttributeValueCtr *r)
2145 {
2146         uint32_t _ptr_values;
2147         uint32_t cntr_values_1;
2148         TALLOC_CTX *_mem_save_values_0;
2149         TALLOC_CTX *_mem_save_values_1;
2150         if (ndr_flags & NDR_SCALARS) {
2151                 NDR_CHECK(ndr_pull_align(ndr, 5));
2152                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_values));
2153                 if (r->num_values > 10485760) {
2154                         return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
2155                 }
2156                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_values));
2157                 if (_ptr_values) {
2158                         NDR_PULL_ALLOC(ndr, r->values);
2159                 } else {
2160                         r->values = NULL;
2161                 }
2162                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
2163         }
2164         if (ndr_flags & NDR_BUFFERS) {
2165                 if (r->values) {
2166                         _mem_save_values_0 = NDR_PULL_GET_MEM_CTX(ndr);
2167                         NDR_PULL_SET_MEM_CTX(ndr, r->values, 0);
2168                         NDR_CHECK(ndr_pull_array_size(ndr, &r->values));
2169                         NDR_PULL_ALLOC_N(ndr, r->values, ndr_get_array_size(ndr, &r->values));
2170                         _mem_save_values_1 = NDR_PULL_GET_MEM_CTX(ndr);
2171                         NDR_PULL_SET_MEM_CTX(ndr, r->values, 0);
2172                         for (cntr_values_1 = 0; cntr_values_1 < r->num_values; cntr_values_1++) {
2173                                 NDR_CHECK(ndr_pull_drsuapi_DsAttributeValue(ndr, NDR_SCALARS, &r->values[cntr_values_1]));
2174                         }
2175                         for (cntr_values_1 = 0; cntr_values_1 < r->num_values; cntr_values_1++) {
2176                                 NDR_CHECK(ndr_pull_drsuapi_DsAttributeValue(ndr, NDR_BUFFERS, &r->values[cntr_values_1]));
2177                         }
2178                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_values_1, 0);
2179                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_values_0, 0);
2180                 }
2181                 if (r->values) {
2182                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->values, r->num_values));
2183                 }
2184         }
2185         return NDR_ERR_SUCCESS;
2186 }
2187
2188 _PUBLIC_ void ndr_print_drsuapi_DsAttributeValueCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAttributeValueCtr *r)
2189 {
2190         uint32_t cntr_values_1;
2191         ndr_print_struct(ndr, name, "drsuapi_DsAttributeValueCtr");
2192         ndr->depth++;
2193         ndr_print_uint32(ndr, "num_values", r->num_values);
2194         ndr_print_ptr(ndr, "values", r->values);
2195         ndr->depth++;
2196         if (r->values) {
2197                 ndr->print(ndr, "%s: ARRAY(%d)", "values", (int)r->num_values);
2198                 ndr->depth++;
2199                 for (cntr_values_1=0;cntr_values_1<r->num_values;cntr_values_1++) {
2200                         char *idx_1=NULL;
2201                         if (asprintf(&idx_1, "[%d]", cntr_values_1) != -1) {
2202                                 ndr_print_drsuapi_DsAttributeValue(ndr, "values", &r->values[cntr_values_1]);
2203                                 free(idx_1);
2204                         }
2205                 }
2206                 ndr->depth--;
2207         }
2208         ndr->depth--;
2209         ndr->depth--;
2210 }
2211
2212 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectIdentifier3(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectIdentifier3 *r)
2213 {
2214         if (ndr_flags & NDR_SCALARS) {
2215                 NDR_CHECK(ndr_push_align(ndr, 4));
2216                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_drsuapi_DsReplicaObjectIdentifier3(r, ndr->iconv_convenience, ndr->flags)));
2217                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_dom_sid28(&r->sid, ndr->flags)));
2218                 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->guid));
2219                 NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_SCALARS, &r->sid));
2220                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m(r->dn)));
2221                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dn, strlen_m(r->dn) + 1, sizeof(uint16_t), CH_UTF16));
2222                 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
2223         }
2224         if (ndr_flags & NDR_BUFFERS) {
2225                 NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_BUFFERS, &r->sid));
2226         }
2227         return NDR_ERR_SUCCESS;
2228 }
2229
2230 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectIdentifier3(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectIdentifier3 *r)
2231 {
2232         if (ndr_flags & NDR_SCALARS) {
2233                 NDR_CHECK(ndr_pull_align(ndr, 4));
2234                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size));
2235                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_sid));
2236                 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->guid));
2237                 NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_SCALARS, &r->sid));
2238                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_dn));
2239                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dn, r->__ndr_size_dn + 1, sizeof(uint16_t), CH_UTF16));
2240                 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
2241         }
2242         if (ndr_flags & NDR_BUFFERS) {
2243                 NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_BUFFERS, &r->sid));
2244         }
2245         return NDR_ERR_SUCCESS;
2246 }
2247
2248 _PUBLIC_ void ndr_print_drsuapi_DsReplicaObjectIdentifier3(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjectIdentifier3 *r)
2249 {
2250         ndr_print_struct(ndr, name, "drsuapi_DsReplicaObjectIdentifier3");
2251         ndr->depth++;
2252         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);
2253         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);
2254         ndr_print_GUID(ndr, "guid", &r->guid);
2255         ndr_print_dom_sid28(ndr, "sid", &r->sid);
2256         ndr_print_uint32(ndr, "__ndr_size_dn", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m(r->dn):r->__ndr_size_dn);
2257         ndr_print_string(ndr, "dn", r->dn);
2258         ndr->depth--;
2259 }
2260
2261 _PUBLIC_ size_t ndr_size_drsuapi_DsReplicaObjectIdentifier3(const struct drsuapi_DsReplicaObjectIdentifier3 *r, struct smb_iconv_convenience *ic, int flags)
2262 {
2263         return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3, ic);
2264 }
2265
2266 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectIdentifier3Binary(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectIdentifier3Binary *r)
2267 {
2268         if (ndr_flags & NDR_SCALARS) {
2269                 NDR_CHECK(ndr_push_align(ndr, 4));
2270                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary_without_Binary(r, ndr->iconv_convenience, ndr->flags)));
2271                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_dom_sid28(&r->sid, ndr->flags)));
2272                 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->guid));
2273                 NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_SCALARS, &r->sid));
2274                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m(r->dn)));
2275                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dn, strlen_m(r->dn) + 1, sizeof(uint16_t), CH_UTF16));
2276                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->binary.length + 4));
2277                 {
2278                         uint32_t _flags_save_DATA_BLOB = ndr->flags;
2279                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
2280                         NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->binary));
2281                         ndr->flags = _flags_save_DATA_BLOB;
2282                 }
2283                 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
2284         }
2285         if (ndr_flags & NDR_BUFFERS) {
2286                 NDR_CHECK(ndr_push_dom_sid28(ndr, NDR_BUFFERS, &r->sid));
2287         }
2288         return NDR_ERR_SUCCESS;
2289 }
2290
2291 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectIdentifier3Binary(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectIdentifier3Binary *r)
2292 {
2293         if (ndr_flags & NDR_SCALARS) {
2294                 NDR_CHECK(ndr_pull_align(ndr, 4));
2295                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size));
2296                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_sid));
2297                 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->guid));
2298                 NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_SCALARS, &r->sid));
2299                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_dn));
2300                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dn, r->__ndr_size_dn + 1, sizeof(uint16_t), CH_UTF16));
2301                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size_binary));
2302                 {
2303                         uint32_t _flags_save_DATA_BLOB = ndr->flags;
2304                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
2305                         NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->binary));
2306                         ndr->flags = _flags_save_DATA_BLOB;
2307                 }
2308                 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
2309         }
2310         if (ndr_flags & NDR_BUFFERS) {
2311                 NDR_CHECK(ndr_pull_dom_sid28(ndr, NDR_BUFFERS, &r->sid));
2312         }
2313         return NDR_ERR_SUCCESS;
2314 }
2315
2316 _PUBLIC_ void ndr_print_drsuapi_DsReplicaObjectIdentifier3Binary(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjectIdentifier3Binary *r)
2317 {
2318         ndr_print_struct(ndr, name, "drsuapi_DsReplicaObjectIdentifier3Binary");
2319         ndr->depth++;
2320         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);
2321         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);
2322         ndr_print_GUID(ndr, "guid", &r->guid);
2323         ndr_print_dom_sid28(ndr, "sid", &r->sid);
2324         ndr_print_uint32(ndr, "__ndr_size_dn", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m(r->dn):r->__ndr_size_dn);
2325         ndr_print_string(ndr, "dn", r->dn);
2326         ndr_print_uint32(ndr, "__ndr_size_binary", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->binary.length + 4:r->__ndr_size_binary);
2327         ndr_print_DATA_BLOB(ndr, "binary", r->binary);
2328         ndr->depth--;
2329 }
2330
2331 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaAttribute(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaAttribute *r)
2332 {
2333         if (ndr_flags & NDR_SCALARS) {
2334                 NDR_CHECK(ndr_push_align(ndr, 5));
2335                 NDR_CHECK(ndr_push_drsuapi_DsAttributeId(ndr, NDR_SCALARS, r->attid));
2336                 NDR_CHECK(ndr_push_drsuapi_DsAttributeValueCtr(ndr, NDR_SCALARS, &r->value_ctr));
2337                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
2338         }
2339         if (ndr_flags & NDR_BUFFERS) {
2340                 NDR_CHECK(ndr_push_drsuapi_DsAttributeValueCtr(ndr, NDR_BUFFERS, &r->value_ctr));
2341         }
2342         return NDR_ERR_SUCCESS;
2343 }
2344
2345 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaAttribute(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaAttribute *r)
2346 {
2347         if (ndr_flags & NDR_SCALARS) {
2348                 NDR_CHECK(ndr_pull_align(ndr, 5));
2349                 NDR_CHECK(ndr_pull_drsuapi_DsAttributeId(ndr, NDR_SCALARS, &r->attid));
2350                 NDR_CHECK(ndr_pull_drsuapi_DsAttributeValueCtr(ndr, NDR_SCALARS, &r->value_ctr));
2351                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
2352         }
2353         if (ndr_flags & NDR_BUFFERS) {
2354                 NDR_CHECK(ndr_pull_drsuapi_DsAttributeValueCtr(ndr, NDR_BUFFERS, &r->value_ctr));
2355         }
2356         return NDR_ERR_SUCCESS;
2357 }
2358
2359 _PUBLIC_ void ndr_print_drsuapi_DsReplicaAttribute(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaAttribute *r)
2360 {
2361         ndr_print_struct(ndr, name, "drsuapi_DsReplicaAttribute");
2362         ndr->depth++;
2363         ndr_print_drsuapi_DsAttributeId(ndr, "attid", r->attid);
2364         ndr_print_drsuapi_DsAttributeValueCtr(ndr, "value_ctr", &r->value_ctr);
2365         ndr->depth--;
2366 }
2367
2368 static enum ndr_err_code ndr_push_drsuapi_DsReplicaAttributeCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaAttributeCtr *r)
2369 {
2370         uint32_t cntr_attributes_1;
2371         if (ndr_flags & NDR_SCALARS) {
2372                 NDR_CHECK(ndr_push_align(ndr, 5));
2373                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_attributes));
2374                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->attributes));
2375                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
2376         }
2377         if (ndr_flags & NDR_BUFFERS) {
2378                 if (r->attributes) {
2379                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->num_attributes));
2380                         for (cntr_attributes_1 = 0; cntr_attributes_1 < r->num_attributes; cntr_attributes_1++) {
2381                                 NDR_CHECK(ndr_push_drsuapi_DsReplicaAttribute(ndr, NDR_SCALARS, &r->attributes[cntr_attributes_1]));
2382                         }
2383                         for (cntr_attributes_1 = 0; cntr_attributes_1 < r->num_attributes; cntr_attributes_1++) {
2384                                 NDR_CHECK(ndr_push_drsuapi_DsReplicaAttribute(ndr, NDR_BUFFERS, &r->attributes[cntr_attributes_1]));
2385                         }
2386                 }
2387         }
2388         return NDR_ERR_SUCCESS;
2389 }
2390
2391 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaAttributeCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaAttributeCtr *r)
2392 {
2393         uint32_t _ptr_attributes;
2394         uint32_t cntr_attributes_1;
2395         TALLOC_CTX *_mem_save_attributes_0;
2396         TALLOC_CTX *_mem_save_attributes_1;
2397         if (ndr_flags & NDR_SCALARS) {
2398                 NDR_CHECK(ndr_pull_align(ndr, 5));
2399                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_attributes));
2400                 if (r->num_attributes > 1048576) {
2401                         return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
2402                 }
2403                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_attributes));
2404                 if (_ptr_attributes) {
2405                         NDR_PULL_ALLOC(ndr, r->attributes);
2406                 } else {
2407                         r->attributes = NULL;
2408                 }
2409                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
2410         }
2411         if (ndr_flags & NDR_BUFFERS) {
2412                 if (r->attributes) {
2413                         _mem_save_attributes_0 = NDR_PULL_GET_MEM_CTX(ndr);
2414                         NDR_PULL_SET_MEM_CTX(ndr, r->attributes, 0);
2415                         NDR_CHECK(ndr_pull_array_size(ndr, &r->attributes));
2416                         NDR_PULL_ALLOC_N(ndr, r->attributes, ndr_get_array_size(ndr, &r->attributes));
2417                         _mem_save_attributes_1 = NDR_PULL_GET_MEM_CTX(ndr);
2418                         NDR_PULL_SET_MEM_CTX(ndr, r->attributes, 0);
2419                         for (cntr_attributes_1 = 0; cntr_attributes_1 < r->num_attributes; cntr_attributes_1++) {
2420                                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttribute(ndr, NDR_SCALARS, &r->attributes[cntr_attributes_1]));
2421                         }
2422                         for (cntr_attributes_1 = 0; cntr_attributes_1 < r->num_attributes; cntr_attributes_1++) {
2423                                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttribute(ndr, NDR_BUFFERS, &r->attributes[cntr_attributes_1]));
2424                         }
2425                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attributes_1, 0);
2426                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attributes_0, 0);
2427                 }
2428                 if (r->attributes) {
2429                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->attributes, r->num_attributes));
2430                 }
2431         }
2432         return NDR_ERR_SUCCESS;
2433 }
2434
2435 _PUBLIC_ void ndr_print_drsuapi_DsReplicaAttributeCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaAttributeCtr *r)
2436 {
2437         uint32_t cntr_attributes_1;
2438         ndr_print_struct(ndr, name, "drsuapi_DsReplicaAttributeCtr");
2439         ndr->depth++;
2440         ndr_print_uint32(ndr, "num_attributes", r->num_attributes);
2441         ndr_print_ptr(ndr, "attributes", r->attributes);
2442         ndr->depth++;
2443         if (r->attributes) {
2444                 ndr->print(ndr, "%s: ARRAY(%d)", "attributes", (int)r->num_attributes);
2445                 ndr->depth++;
2446                 for (cntr_attributes_1=0;cntr_attributes_1<r->num_attributes;cntr_attributes_1++) {
2447                         char *idx_1=NULL;
2448                         if (asprintf(&idx_1, "[%d]", cntr_attributes_1) != -1) {
2449                                 ndr_print_drsuapi_DsReplicaAttribute(ndr, "attributes", &r->attributes[cntr_attributes_1]);
2450                                 free(idx_1);
2451                         }
2452                 }
2453                 ndr->depth--;
2454         }
2455         ndr->depth--;
2456         ndr->depth--;
2457 }
2458
2459 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
2460 {
2461         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
2462         return NDR_ERR_SUCCESS;
2463 }
2464
2465 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
2466 {
2467         uint32_t v;
2468         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
2469         *r = v;
2470         return NDR_ERR_SUCCESS;
2471 }
2472
2473 _PUBLIC_ void ndr_print_drsuapi_DsReplicaObjectFlags(struct ndr_print *ndr, const char *name, uint32_t r)
2474 {
2475         ndr_print_uint32(ndr, name, r);
2476         ndr->depth++;
2477         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_OBJECT_FROM_MASTER", DRSUAPI_DS_REPLICA_OBJECT_FROM_MASTER, r);
2478         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_OBJECT_DYNAMIC", DRSUAPI_DS_REPLICA_OBJECT_DYNAMIC, r);
2479         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_REPLICA_OBJECT_REMOTE_MODIFY", DRSUAPI_DS_REPLICA_OBJECT_REMOTE_MODIFY, r);
2480         ndr->depth--;
2481 }
2482
2483 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObject(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObject *r)
2484 {
2485         if (ndr_flags & NDR_SCALARS) {
2486                 NDR_CHECK(ndr_push_align(ndr, 5));
2487                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->identifier));
2488                 NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectFlags(ndr, NDR_SCALARS, r->flags));
2489                 NDR_CHECK(ndr_push_drsuapi_DsReplicaAttributeCtr(ndr, NDR_SCALARS, &r->attribute_ctr));
2490                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
2491         }
2492         if (ndr_flags & NDR_BUFFERS) {
2493                 if (r->identifier) {
2494                         NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->identifier));
2495                 }
2496                 NDR_CHECK(ndr_push_drsuapi_DsReplicaAttributeCtr(ndr, NDR_BUFFERS, &r->attribute_ctr));
2497         }
2498         return NDR_ERR_SUCCESS;
2499 }
2500
2501 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaObject(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObject *r)
2502 {
2503         uint32_t _ptr_identifier;
2504         TALLOC_CTX *_mem_save_identifier_0;
2505         if (ndr_flags & NDR_SCALARS) {
2506                 NDR_CHECK(ndr_pull_align(ndr, 5));
2507                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_identifier));
2508                 if (_ptr_identifier) {
2509                         NDR_PULL_ALLOC(ndr, r->identifier);
2510                 } else {
2511                         r->identifier = NULL;
2512                 }
2513                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectFlags(ndr, NDR_SCALARS, &r->flags));
2514                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttributeCtr(ndr, NDR_SCALARS, &r->attribute_ctr));
2515                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
2516         }
2517         if (ndr_flags & NDR_BUFFERS) {
2518                 if (r->identifier) {
2519                         _mem_save_identifier_0 = NDR_PULL_GET_MEM_CTX(ndr);
2520                         NDR_PULL_SET_MEM_CTX(ndr, r->identifier, 0);
2521                         NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->identifier));
2522                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_identifier_0, 0);
2523                 }
2524                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaAttributeCtr(ndr, NDR_BUFFERS, &r->attribute_ctr));
2525         }
2526         return NDR_ERR_SUCCESS;
2527 }
2528
2529 _PUBLIC_ void ndr_print_drsuapi_DsReplicaObject(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObject *r)
2530 {
2531         ndr_print_struct(ndr, name, "drsuapi_DsReplicaObject");
2532         ndr->depth++;
2533         ndr_print_ptr(ndr, "identifier", r->identifier);
2534         ndr->depth++;
2535         if (r->identifier) {
2536                 ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "identifier", r->identifier);
2537         }
2538         ndr->depth--;
2539         ndr_print_drsuapi_DsReplicaObjectFlags(ndr, "flags", r->flags);
2540         ndr_print_drsuapi_DsReplicaAttributeCtr(ndr, "attribute_ctr", &r->attribute_ctr);
2541         ndr->depth--;
2542 }
2543
2544 static enum ndr_err_code ndr_push_drsuapi_DsReplicaMetaData(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaMetaData *r)
2545 {
2546         if (ndr_flags & NDR_SCALARS) {
2547                 NDR_CHECK(ndr_push_align(ndr, 8));
2548                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version));
2549                 NDR_CHECK(ndr_push_NTTIME_1sec(ndr, NDR_SCALARS, r->originating_change_time));
2550                 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id));
2551                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->originating_usn));
2552                 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
2553         }
2554         if (ndr_flags & NDR_BUFFERS) {
2555         }
2556         return NDR_ERR_SUCCESS;
2557 }
2558
2559 static enum ndr_err_code ndr_pull_drsuapi_DsReplicaMetaData(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaMetaData *r)
2560 {
2561         if (ndr_flags & NDR_SCALARS) {
2562                 NDR_CHECK(ndr_pull_align(ndr, 8));
2563                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
2564                 NDR_CHECK(ndr_pull_NTTIME_1sec(ndr, NDR_SCALARS, &r->originating_change_time));
2565                 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->originating_invocation_id));
2566                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->originating_usn));
2567                 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
2568         }
2569         if (ndr_flags & NDR_BUFFERS) {
2570         }
2571         return NDR_ERR_SUCCESS;
2572 }
2573
2574 _PUBLIC_ void ndr_print_drsuapi_DsReplicaMetaData(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaMetaData *r)
2575 {
2576         ndr_print_struct(ndr, name, "drsuapi_DsReplicaMetaData");
2577         ndr->depth++;
2578         ndr_print_uint32(ndr, "version", r->version);
2579         ndr_print_NTTIME_1sec(ndr, "originating_change_time", r->originating_change_time);
2580         ndr_print_GUID(ndr, "originating_invocation_id", &r->originating_invocation_id);
2581         ndr_print_hyper(ndr, "originating_usn", r->originating_usn);
2582         ndr->depth--;
2583 }
2584
2585 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaMetaDataCtr(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaMetaDataCtr *r)
2586 {
2587         uint32_t cntr_meta_data_0;
2588         if (ndr_flags & NDR_SCALARS) {
2589                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
2590                 NDR_CHECK(ndr_push_align(ndr, 8));
2591                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
2592                 for (cntr_meta_data_0 = 0; cntr_meta_data_0 < r->count; cntr_meta_data_0++) {
2593                         NDR_CHECK(ndr_push_drsuapi_DsReplicaMetaData(ndr, NDR_SCALARS, &r->meta_data[cntr_meta_data_0]));
2594                 }
2595                 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
2596         }
2597         if (ndr_flags & NDR_BUFFERS) {
2598         }
2599         return NDR_ERR_SUCCESS;
2600 }
2601
2602 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaMetaDataCtr(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaMetaDataCtr *r)
2603 {
2604         uint32_t cntr_meta_data_0;
2605         TALLOC_CTX *_mem_save_meta_data_0;
2606         if (ndr_flags & NDR_SCALARS) {
2607                 NDR_CHECK(ndr_pull_array_size(ndr, &r->meta_data));
2608                 NDR_CHECK(ndr_pull_align(ndr, 8));
2609                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
2610                 if (r->count > 1048576) {
2611                         return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
2612                 }
2613                 NDR_PULL_ALLOC_N(ndr, r->meta_data, ndr_get_array_size(ndr, &r->meta_data));
2614                 _mem_save_meta_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
2615                 NDR_PULL_SET_MEM_CTX(ndr, r->meta_data, 0);
2616                 for (cntr_meta_data_0 = 0; cntr_meta_data_0 < r->count; cntr_meta_data_0++) {
2617                         NDR_CHECK(ndr_pull_drsuapi_DsReplicaMetaData(ndr, NDR_SCALARS, &r->meta_data[cntr_meta_data_0]));
2618                 }
2619                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_meta_data_0, 0);
2620                 if (r->meta_data) {
2621                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->meta_data, r->count));
2622                 }
2623                 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
2624         }
2625         if (ndr_flags & NDR_BUFFERS) {
2626         }
2627         return NDR_ERR_SUCCESS;
2628 }
2629
2630 _PUBLIC_ void ndr_print_drsuapi_DsReplicaMetaDataCtr(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaMetaDataCtr *r)
2631 {
2632         uint32_t cntr_meta_data_0;
2633         ndr_print_struct(ndr, name, "drsuapi_DsReplicaMetaDataCtr");
2634         ndr->depth++;
2635         ndr_print_uint32(ndr, "count", r->count);
2636         ndr->print(ndr, "%s: ARRAY(%d)", "meta_data", (int)r->count);
2637         ndr->depth++;
2638         for (cntr_meta_data_0=0;cntr_meta_data_0<r->count;cntr_meta_data_0++) {
2639                 char *idx_0=NULL;
2640                 if (asprintf(&idx_0, "[%d]", cntr_meta_data_0) != -1) {
2641                         ndr_print_drsuapi_DsReplicaMetaData(ndr, "meta_data", &r->meta_data[cntr_meta_data_0]);
2642                         free(idx_0);
2643                 }
2644         }
2645         ndr->depth--;
2646         ndr->depth--;
2647 }
2648
2649 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectListItemEx(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaObjectListItemEx *r)
2650 {
2651         if (ndr_flags & NDR_SCALARS) {
2652                 NDR_CHECK(ndr_push_align(ndr, 5));
2653                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->next_object));
2654                 NDR_CHECK(ndr_push_drsuapi_DsReplicaObject(ndr, NDR_SCALARS, &r->object));
2655                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_nc_prefix));
2656                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->parent_object_guid));
2657                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->meta_data_ctr));
2658                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
2659         }
2660         if (ndr_flags & NDR_BUFFERS) {
2661                 if (r->next_object) {
2662                         NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectListItemEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->next_object));
2663                 }
2664                 NDR_CHECK(ndr_push_drsuapi_DsReplicaObject(ndr, NDR_BUFFERS, &r->object));
2665                 if (r->parent_object_guid) {
2666                         NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->parent_object_guid));
2667                 }
2668                 if (r->meta_data_ctr) {
2669                         NDR_CHECK(ndr_push_drsuapi_DsReplicaMetaDataCtr(ndr, NDR_SCALARS, r->meta_data_ctr));
2670                 }
2671         }
2672         return NDR_ERR_SUCCESS;
2673 }
2674
2675 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectListItemEx(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaObjectListItemEx *r)
2676 {
2677         uint32_t _ptr_next_object;
2678         TALLOC_CTX *_mem_save_next_object_0;
2679         uint32_t _ptr_parent_object_guid;
2680         TALLOC_CTX *_mem_save_parent_object_guid_0;
2681         uint32_t _ptr_meta_data_ctr;
2682         TALLOC_CTX *_mem_save_meta_data_ctr_0;
2683         if (ndr_flags & NDR_SCALARS) {
2684                 NDR_CHECK(ndr_pull_align(ndr, 5));
2685                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_next_object));
2686                 if (_ptr_next_object) {
2687                         NDR_PULL_ALLOC(ndr, r->next_object);
2688                 } else {
2689                         r->next_object = NULL;
2690                 }
2691                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObject(ndr, NDR_SCALARS, &r->object));
2692                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_nc_prefix));
2693                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_parent_object_guid));
2694                 if (_ptr_parent_object_guid) {
2695                         NDR_PULL_ALLOC(ndr, r->parent_object_guid);
2696                 } else {
2697                         r->parent_object_guid = NULL;
2698                 }
2699                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_meta_data_ctr));
2700                 if (_ptr_meta_data_ctr) {
2701                         NDR_PULL_ALLOC(ndr, r->meta_data_ctr);
2702                 } else {
2703                         r->meta_data_ctr = NULL;
2704                 }
2705                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
2706         }
2707         if (ndr_flags & NDR_BUFFERS) {
2708                 if (r->next_object) {
2709                         _mem_save_next_object_0 = NDR_PULL_GET_MEM_CTX(ndr);
2710                         NDR_PULL_SET_MEM_CTX(ndr, r->next_object, 0);
2711                         NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectListItemEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->next_object));
2712                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_next_object_0, 0);
2713                 }
2714                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaObject(ndr, NDR_BUFFERS, &r->object));
2715                 if (r->parent_object_guid) {
2716                         _mem_save_parent_object_guid_0 = NDR_PULL_GET_MEM_CTX(ndr);
2717                         NDR_PULL_SET_MEM_CTX(ndr, r->parent_object_guid, 0);
2718                         NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, r->parent_object_guid));
2719                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parent_object_guid_0, 0);
2720                 }
2721                 if (r->meta_data_ctr) {
2722                         _mem_save_meta_data_ctr_0 = NDR_PULL_GET_MEM_CTX(ndr);
2723                         NDR_PULL_SET_MEM_CTX(ndr, r->meta_data_ctr, 0);
2724                         NDR_CHECK(ndr_pull_drsuapi_DsReplicaMetaDataCtr(ndr, NDR_SCALARS, r->meta_data_ctr));
2725                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_meta_data_ctr_0, 0);
2726                 }
2727         }
2728         return NDR_ERR_SUCCESS;
2729 }
2730
2731 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesCtr1 *r)
2732 {
2733         if (ndr_flags & NDR_SCALARS) {
2734                 NDR_CHECK(ndr_push_align(ndr, 8));
2735                 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_guid));
2736                 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
2737                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->naming_context));
2738                 NDR_CHECK(ndr_push_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->old_highwatermark));
2739                 NDR_CHECK(ndr_push_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->new_highwatermark));
2740                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->uptodateness_vector));
2741                 NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_SCALARS, &r->mapping_ctr));
2742                 NDR_CHECK(ndr_push_drsuapi_DsExtendedError(ndr, NDR_SCALARS, r->extended_ret));
2743                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->object_count));
2744                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_drsuapi_DsGetNCChangesCtr1(r, ndr->iconv_convenience, ndr->flags) + 55));
2745                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->first_object));
2746                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->more_data));
2747                 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
2748         }
2749         if (ndr_flags & NDR_BUFFERS) {
2750                 if (r->naming_context) {
2751                         NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
2752                 }
2753                 if (r->uptodateness_vector) {
2754                         NDR_CHECK(ndr_push_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->uptodateness_vector));
2755                 }
2756                 NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->mapping_ctr));
2757                 if (r->first_object) {
2758                         NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectListItemEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->first_object));
2759                 }
2760         }
2761         return NDR_ERR_SUCCESS;
2762 }
2763
2764 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesCtr1 *r)
2765 {
2766         uint32_t _ptr_naming_context;
2767         TALLOC_CTX *_mem_save_naming_context_0;
2768         uint32_t _ptr_uptodateness_vector;
2769         TALLOC_CTX *_mem_save_uptodateness_vector_0;
2770         uint32_t _ptr_first_object;
2771         TALLOC_CTX *_mem_save_first_object_0;
2772         if (ndr_flags & NDR_SCALARS) {
2773                 NDR_CHECK(ndr_pull_align(ndr, 8));
2774                 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_guid));
2775                 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
2776                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_naming_context));
2777                 if (_ptr_naming_context) {
2778                         NDR_PULL_ALLOC(ndr, r->naming_context);
2779                 } else {
2780                         r->naming_context = NULL;
2781                 }
2782                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->old_highwatermark));
2783                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->new_highwatermark));
2784                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_uptodateness_vector));
2785                 if (_ptr_uptodateness_vector) {
2786                         NDR_PULL_ALLOC(ndr, r->uptodateness_vector);
2787                 } else {
2788                         r->uptodateness_vector = NULL;
2789                 }
2790                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_SCALARS, &r->mapping_ctr));
2791                 NDR_CHECK(ndr_pull_drsuapi_DsExtendedError(ndr, NDR_SCALARS, &r->extended_ret));
2792                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->object_count));
2793                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size));
2794                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_first_object));
2795                 if (_ptr_first_object) {
2796                         NDR_PULL_ALLOC(ndr, r->first_object);
2797                 } else {
2798                         r->first_object = NULL;
2799                 }
2800                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->more_data));
2801                 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
2802         }
2803         if (ndr_flags & NDR_BUFFERS) {
2804                 if (r->naming_context) {
2805                         _mem_save_naming_context_0 = NDR_PULL_GET_MEM_CTX(ndr);
2806                         NDR_PULL_SET_MEM_CTX(ndr, r->naming_context, 0);
2807                         NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
2808                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_naming_context_0, 0);
2809                 }
2810                 if (r->uptodateness_vector) {
2811                         _mem_save_uptodateness_vector_0 = NDR_PULL_GET_MEM_CTX(ndr);
2812                         NDR_PULL_SET_MEM_CTX(ndr, r->uptodateness_vector, 0);
2813                         NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursorCtrEx(ndr, NDR_SCALARS, r->uptodateness_vector));
2814                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_uptodateness_vector_0, 0);
2815                 }
2816                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->mapping_ctr));
2817                 if (r->first_object) {
2818                         _mem_save_first_object_0 = NDR_PULL_GET_MEM_CTX(ndr);
2819                         NDR_PULL_SET_MEM_CTX(ndr, r->first_object, 0);
2820                         NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectListItemEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->first_object));
2821                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_first_object_0, 0);
2822                 }
2823         }
2824         return NDR_ERR_SUCCESS;
2825 }
2826
2827 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr1 *r)
2828 {
2829         ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesCtr1");
2830         ndr->depth++;
2831         ndr_print_GUID(ndr, "source_dsa_guid", &r->source_dsa_guid);
2832         ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id);
2833         ndr_print_ptr(ndr, "naming_context", r->naming_context);
2834         ndr->depth++;
2835         if (r->naming_context) {
2836                 ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "naming_context", r->naming_context);
2837         }
2838         ndr->depth--;
2839         ndr_print_drsuapi_DsReplicaHighWaterMark(ndr, "old_highwatermark", &r->old_highwatermark);
2840         ndr_print_drsuapi_DsReplicaHighWaterMark(ndr, "new_highwatermark", &r->new_highwatermark);
2841         ndr_print_ptr(ndr, "uptodateness_vector", r->uptodateness_vector);
2842         ndr->depth++;
2843         if (r->uptodateness_vector) {
2844                 ndr_print_drsuapi_DsReplicaCursorCtrEx(ndr, "uptodateness_vector", r->uptodateness_vector);
2845         }
2846         ndr->depth--;
2847         ndr_print_drsuapi_DsReplicaOIDMapping_Ctr(ndr, "mapping_ctr", &r->mapping_ctr);
2848         ndr_print_drsuapi_DsExtendedError(ndr, "extended_ret", r->extended_ret);
2849         ndr_print_uint32(ndr, "object_count", r->object_count);
2850         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);
2851         ndr_print_ptr(ndr, "first_object", r->first_object);
2852         ndr->depth++;
2853         if (r->first_object) {
2854                 ndr_print_drsuapi_DsReplicaObjectListItemEx(ndr, "first_object", r->first_object);
2855         }
2856         ndr->depth--;
2857         ndr_print_uint32(ndr, "more_data", r->more_data);
2858         ndr->depth--;
2859 }
2860
2861 _PUBLIC_ size_t ndr_size_drsuapi_DsGetNCChangesCtr1(const struct drsuapi_DsGetNCChangesCtr1 *r, struct smb_iconv_convenience *ic, int flags)
2862 {
2863         return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsGetNCChangesCtr1, ic);
2864 }
2865
2866 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsLinkedAttributeFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
2867 {
2868         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
2869         return NDR_ERR_SUCCESS;
2870 }
2871
2872 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsLinkedAttributeFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
2873 {
2874         uint32_t v;
2875         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
2876         *r = v;
2877         return NDR_ERR_SUCCESS;
2878 }
2879
2880 _PUBLIC_ void ndr_print_drsuapi_DsLinkedAttributeFlags(struct ndr_print *ndr, const char *name, uint32_t r)
2881 {
2882         ndr_print_uint32(ndr, name, r);
2883         ndr->depth++;
2884         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DRSUAPI_DS_LINKED_ATTRIBUTE_FLAG_ACTIVE", DRSUAPI_DS_LINKED_ATTRIBUTE_FLAG_ACTIVE, r);
2885         ndr->depth--;
2886 }
2887
2888 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsReplicaLinkedAttribute(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaLinkedAttribute *r)
2889 {
2890         if (ndr_flags & NDR_SCALARS) {
2891                 NDR_CHECK(ndr_push_align(ndr, 8));
2892                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->identifier));
2893                 NDR_CHECK(ndr_push_drsuapi_DsAttributeId(ndr, NDR_SCALARS, r->attid));
2894                 NDR_CHECK(ndr_push_drsuapi_DsAttributeValue(ndr, NDR_SCALARS, &r->value));
2895                 NDR_CHECK(ndr_push_drsuapi_DsLinkedAttributeFlags(ndr, NDR_SCALARS, r->flags));
2896                 NDR_CHECK(ndr_push_NTTIME_1sec(ndr, NDR_SCALARS, r->originating_add_time));
2897                 NDR_CHECK(ndr_push_drsuapi_DsReplicaMetaData(ndr, NDR_SCALARS, &r->meta_data));
2898                 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
2899         }
2900         if (ndr_flags & NDR_BUFFERS) {
2901                 if (r->identifier) {
2902                         NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->identifier));
2903                 }
2904                 NDR_CHECK(ndr_push_drsuapi_DsAttributeValue(ndr, NDR_BUFFERS, &r->value));
2905         }
2906         return NDR_ERR_SUCCESS;
2907 }
2908
2909 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsReplicaLinkedAttribute(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaLinkedAttribute *r)
2910 {
2911         uint32_t _ptr_identifier;
2912         TALLOC_CTX *_mem_save_identifier_0;
2913         if (ndr_flags & NDR_SCALARS) {
2914                 NDR_CHECK(ndr_pull_align(ndr, 8));
2915                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_identifier));
2916                 if (_ptr_identifier) {
2917                         NDR_PULL_ALLOC(ndr, r->identifier);
2918                 } else {
2919                         r->identifier = NULL;
2920                 }
2921                 NDR_CHECK(ndr_pull_drsuapi_DsAttributeId(ndr, NDR_SCALARS, &r->attid));
2922                 NDR_CHECK(ndr_pull_drsuapi_DsAttributeValue(ndr, NDR_SCALARS, &r->value));
2923                 NDR_CHECK(ndr_pull_drsuapi_DsLinkedAttributeFlags(ndr, NDR_SCALARS, &r->flags));
2924                 NDR_CHECK(ndr_pull_NTTIME_1sec(ndr, NDR_SCALARS, &r->originating_add_time));
2925                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaMetaData(ndr, NDR_SCALARS, &r->meta_data));
2926                 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
2927         }
2928         if (ndr_flags & NDR_BUFFERS) {
2929                 if (r->identifier) {
2930                         _mem_save_identifier_0 = NDR_PULL_GET_MEM_CTX(ndr);
2931                         NDR_PULL_SET_MEM_CTX(ndr, r->identifier, 0);
2932                         NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->identifier));
2933                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_identifier_0, 0);
2934                 }
2935                 NDR_CHECK(ndr_pull_drsuapi_DsAttributeValue(ndr, NDR_BUFFERS, &r->value));
2936         }
2937         return NDR_ERR_SUCCESS;
2938 }
2939
2940 _PUBLIC_ void ndr_print_drsuapi_DsReplicaLinkedAttribute(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaLinkedAttribute *r)
2941 {
2942         ndr_print_struct(ndr, name, "drsuapi_DsReplicaLinkedAttribute");
2943         ndr->depth++;
2944         ndr_print_ptr(ndr, "identifier", r->identifier);
2945         ndr->depth++;
2946         if (r->identifier) {
2947                 ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "identifier", r->identifier);
2948         }
2949         ndr->depth--;
2950         ndr_print_drsuapi_DsAttributeId(ndr, "attid", r->attid);
2951         ndr_print_drsuapi_DsAttributeValue(ndr, "value", &r->value);
2952         ndr_print_drsuapi_DsLinkedAttributeFlags(ndr, "flags", r->flags);
2953         ndr_print_NTTIME_1sec(ndr, "originating_add_time", r->originating_add_time);
2954         ndr_print_drsuapi_DsReplicaMetaData(ndr, "meta_data", &r->meta_data);
2955         ndr->depth--;
2956 }
2957
2958 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr6(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesCtr6 *r)
2959 {
2960         uint32_t cntr_linked_attributes_1;
2961         if (ndr_flags & NDR_SCALARS) {
2962                 NDR_CHECK(ndr_push_align(ndr, 8));
2963                 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_guid));
2964                 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
2965                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->naming_context));
2966                 NDR_CHECK(ndr_push_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->old_highwatermark));
2967                 NDR_CHECK(ndr_push_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->new_highwatermark));
2968                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->uptodateness_vector));
2969                 NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_SCALARS, &r->mapping_ctr));
2970                 NDR_CHECK(ndr_push_drsuapi_DsExtendedError(ndr, NDR_SCALARS, r->extended_ret));
2971                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->object_count));
2972                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_drsuapi_DsGetNCChangesCtr6(r, ndr->iconv_convenience, ndr->flags) + 55));
2973                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->first_object));
2974                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->more_data));
2975                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->nc_object_count));
2976                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->nc_linked_attributes_count));
2977                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->linked_attributes_count));
2978                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->linked_attributes));
2979                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->drs_error));
2980                 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
2981         }
2982         if (ndr_flags & NDR_BUFFERS) {
2983                 if (r->naming_context) {
2984                         NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
2985                 }
2986                 if (r->uptodateness_vector) {
2987                         NDR_CHECK(ndr_push_drsuapi_DsReplicaCursor2CtrEx(ndr, NDR_SCALARS, r->uptodateness_vector));
2988                 }
2989                 NDR_CHECK(ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->mapping_ctr));
2990                 if (r->first_object) {
2991                         NDR_CHECK(ndr_push_drsuapi_DsReplicaObjectListItemEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->first_object));
2992                 }
2993                 if (r->linked_attributes) {
2994                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->linked_attributes_count));
2995                         for (cntr_linked_attributes_1 = 0; cntr_linked_attributes_1 < r->linked_attributes_count; cntr_linked_attributes_1++) {
2996                                 NDR_CHECK(ndr_push_drsuapi_DsReplicaLinkedAttribute(ndr, NDR_SCALARS, &r->linked_attributes[cntr_linked_attributes_1]));
2997                         }
2998                         for (cntr_linked_attributes_1 = 0; cntr_linked_attributes_1 < r->linked_attributes_count; cntr_linked_attributes_1++) {
2999                                 NDR_CHECK(ndr_push_drsuapi_DsReplicaLinkedAttribute(ndr, NDR_BUFFERS, &r->linked_attributes[cntr_linked_attributes_1]));
3000                         }
3001                 }
3002         }
3003         return NDR_ERR_SUCCESS;
3004 }
3005
3006 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr6(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesCtr6 *r)
3007 {
3008         uint32_t _ptr_naming_context;
3009         TALLOC_CTX *_mem_save_naming_context_0;
3010         uint32_t _ptr_uptodateness_vector;
3011         TALLOC_CTX *_mem_save_uptodateness_vector_0;
3012         uint32_t _ptr_first_object;
3013         TALLOC_CTX *_mem_save_first_object_0;
3014         uint32_t _ptr_linked_attributes;
3015         uint32_t cntr_linked_attributes_1;
3016         TALLOC_CTX *_mem_save_linked_attributes_0;
3017         TALLOC_CTX *_mem_save_linked_attributes_1;
3018         if (ndr_flags & NDR_SCALARS) {
3019                 NDR_CHECK(ndr_pull_align(ndr, 8));
3020                 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_guid));
3021                 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->source_dsa_invocation_id));
3022                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_naming_context));
3023                 if (_ptr_naming_context) {
3024                         NDR_PULL_ALLOC(ndr, r->naming_context);
3025                 } else {
3026                         r->naming_context = NULL;
3027                 }
3028                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->old_highwatermark));
3029                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaHighWaterMark(ndr, NDR_SCALARS, &r->new_highwatermark));
3030                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_uptodateness_vector));
3031                 if (_ptr_uptodateness_vector) {
3032                         NDR_PULL_ALLOC(ndr, r->uptodateness_vector);
3033                 } else {
3034                         r->uptodateness_vector = NULL;
3035                 }
3036                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_SCALARS, &r->mapping_ctr));
3037                 NDR_CHECK(ndr_pull_drsuapi_DsExtendedError(ndr, NDR_SCALARS, &r->extended_ret));
3038                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->object_count));
3039                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size));
3040                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_first_object));
3041                 if (_ptr_first_object) {
3042                         NDR_PULL_ALLOC(ndr, r->first_object);
3043                 } else {
3044                         r->first_object = NULL;
3045                 }
3046                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->more_data));
3047                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->nc_object_count));
3048                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->nc_linked_attributes_count));
3049                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->linked_attributes_count));
3050                 if (r->linked_attributes_count > 1048576) {
3051                         return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
3052                 }
3053                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_linked_attributes));
3054                 if (_ptr_linked_attributes) {
3055                         NDR_PULL_ALLOC(ndr, r->linked_attributes);
3056                 } else {
3057                         r->linked_attributes = NULL;
3058                 }
3059                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->drs_error));
3060                 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
3061         }
3062         if (ndr_flags & NDR_BUFFERS) {
3063                 if (r->naming_context) {
3064                         _mem_save_naming_context_0 = NDR_PULL_GET_MEM_CTX(ndr);
3065                         NDR_PULL_SET_MEM_CTX(ndr, r->naming_context, 0);
3066                         NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectIdentifier(ndr, NDR_SCALARS|NDR_BUFFERS, r->naming_context));
3067                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_naming_context_0, 0);
3068                 }
3069                 if (r->uptodateness_vector) {
3070                         _mem_save_uptodateness_vector_0 = NDR_PULL_GET_MEM_CTX(ndr);
3071                         NDR_PULL_SET_MEM_CTX(ndr, r->uptodateness_vector, 0);
3072                         NDR_CHECK(ndr_pull_drsuapi_DsReplicaCursor2CtrEx(ndr, NDR_SCALARS, r->uptodateness_vector));
3073                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_uptodateness_vector_0, 0);
3074                 }
3075                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaOIDMapping_Ctr(ndr, NDR_BUFFERS, &r->mapping_ctr));
3076                 if (r->first_object) {
3077                         _mem_save_first_object_0 = NDR_PULL_GET_MEM_CTX(ndr);
3078                         NDR_PULL_SET_MEM_CTX(ndr, r->first_object, 0);
3079                         NDR_CHECK(ndr_pull_drsuapi_DsReplicaObjectListItemEx(ndr, NDR_SCALARS|NDR_BUFFERS, r->first_object));
3080                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_first_object_0, 0);
3081                 }
3082                 if (r->linked_attributes) {
3083                         _mem_save_linked_attributes_0 = NDR_PULL_GET_MEM_CTX(ndr);
3084                         NDR_PULL_SET_MEM_CTX(ndr, r->linked_attributes, 0);
3085                         NDR_CHECK(ndr_pull_array_size(ndr, &r->linked_attributes));
3086                         NDR_PULL_ALLOC_N(ndr, r->linked_attributes, ndr_get_array_size(ndr, &r->linked_attributes));
3087                         _mem_save_linked_attributes_1 = NDR_PULL_GET_MEM_CTX(ndr);
3088                         NDR_PULL_SET_MEM_CTX(ndr, r->linked_attributes, 0);
3089                         for (cntr_linked_attributes_1 = 0; cntr_linked_attributes_1 < r->linked_attributes_count; cntr_linked_attributes_1++) {
3090                                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaLinkedAttribute(ndr, NDR_SCALARS, &r->linked_attributes[cntr_linked_attributes_1]));
3091                         }
3092                         for (cntr_linked_attributes_1 = 0; cntr_linked_attributes_1 < r->linked_attributes_count; cntr_linked_attributes_1++) {
3093                                 NDR_CHECK(ndr_pull_drsuapi_DsReplicaLinkedAttribute(ndr, NDR_BUFFERS, &r->linked_attributes[cntr_linked_attributes_1]));
3094                         }
3095                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_linked_attributes_1, 0);
3096                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_linked_attributes_0, 0);
3097                 }
3098                 if (r->linked_attributes) {
3099                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->linked_attributes, r->linked_attributes_count));
3100                 }
3101         }
3102         return NDR_ERR_SUCCESS;
3103 }
3104
3105 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCtr6(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr6 *r)
3106 {
3107         uint32_t cntr_linked_attributes_1;
3108         ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesCtr6");
3109         ndr->depth++;
3110         ndr_print_GUID(ndr, "source_dsa_guid", &r->source_dsa_guid);
3111         ndr_print_GUID(ndr, "source_dsa_invocation_id", &r->source_dsa_invocation_id);
3112         ndr_print_ptr(ndr, "naming_context", r->naming_context);
3113         ndr->depth++;
3114         if (r->naming_context) {
3115                 ndr_print_drsuapi_DsReplicaObjectIdentifier(ndr, "naming_context", r->naming_context);
3116         }
3117         ndr->depth--;
3118         ndr_print_drsuapi_DsReplicaHighWaterMark(ndr, "old_highwatermark", &r->old_highwatermark);
3119         ndr_print_drsuapi_DsReplicaHighWaterMark(ndr, "new_highwatermark", &r->new_highwatermark);
3120         ndr_print_ptr(ndr, "uptodateness_vector", r->uptodateness_vector);
3121         ndr->depth++;
3122         if (r->uptodateness_vector) {
3123                 ndr_print_drsuapi_DsReplicaCursor2CtrEx(ndr, "uptodateness_vector", r->uptodateness_vector);
3124         }
3125         ndr->depth--;
3126         ndr_print_drsuapi_DsReplicaOIDMapping_Ctr(ndr, "mapping_ctr", &r->mapping_ctr);
3127         ndr_print_drsuapi_DsExtendedError(ndr, "extended_ret", r->extended_ret);
3128         ndr_print_uint32(ndr, "object_count", r->object_count);
3129         ndr_print_uint32(ndr, "__ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_drsuapi_DsGetNCChangesCtr6(r, ndr->iconv_convenience, ndr->flags) + 55:r->__ndr_size);
3130         ndr_print_ptr(ndr, "first_object", r->first_object);
3131         ndr->depth++;
3132         if (r->first_object) {
3133                 ndr_print_drsuapi_DsReplicaObjectListItemEx(ndr, "first_object", r->first_object);
3134         }
3135         ndr->depth--;
3136         ndr_print_uint32(ndr, "more_data", r->more_data);
3137         ndr_print_uint32(ndr, "nc_object_count", r->nc_object_count);
3138         ndr_print_uint32(ndr, "nc_linked_attributes_count", r->nc_linked_attributes_count);
3139         ndr_print_uint32(ndr, "linked_attributes_count", r->linked_attributes_count);
3140         ndr_print_ptr(ndr, "linked_attributes", r->linked_attributes);
3141         ndr->depth++;
3142         if (r->linked_attributes) {
3143                 ndr->print(ndr, "%s: ARRAY(%d)", "linked_attributes", (int)r->linked_attributes_count);
3144                 ndr->depth++;
3145                 for (cntr_linked_attributes_1=0;cntr_linked_attributes_1<r->linked_attributes_count;cntr_linked_attributes_1++) {
3146                         char *idx_1=NULL;
3147                         if (asprintf(&idx_1, "[%d]", cntr_linked_attributes_1) != -1) {
3148                                 ndr_print_drsuapi_DsReplicaLinkedAttribute(ndr, "linked_attributes", &r->linked_attributes[cntr_linked_attributes_1]);
3149                                 free(idx_1);
3150                         }
3151                 }
3152                 ndr->depth--;
3153         }
3154         ndr->depth--;
3155         ndr_print_WERROR(ndr, "drs_error", r->drs_error);
3156         ndr->depth--;
3157 }
3158
3159 _PUBLIC_ size_t ndr_size_drsuapi_DsGetNCChangesCtr6(const struct drsuapi_DsGetNCChangesCtr6 *r, struct smb_iconv_convenience *ic, int flags)
3160 {
3161         return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsGetNCChangesCtr6, ic);
3162 }
3163
3164 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr1TS(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesCtr1TS *r)
3165 {
3166         if (ndr_flags & NDR_SCALARS) {
3167                 NDR_CHECK(ndr_push_align(ndr, 1));
3168                 {
3169                         struct ndr_push *_ndr_ctr1;
3170                         NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_ctr1, 0xFFFFFC01, -1));
3171                         NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr1(_ndr_ctr1, NDR_SCALARS|NDR_BUFFERS, &r->ctr1));
3172                         NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_ctr1, 0xFFFFFC01, -1));
3173                 }
3174                 NDR_CHECK(ndr_push_trailer_align(ndr, 1));
3175         }
3176         if (ndr_flags & NDR_BUFFERS) {
3177         }
3178         return NDR_ERR_SUCCESS;
3179 }
3180
3181 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr1TS(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesCtr1TS *r)
3182 {
3183         if (ndr_flags & NDR_SCALARS) {
3184                 NDR_CHECK(ndr_pull_align(ndr, 1));
3185                 {
3186                         struct ndr_pull *_ndr_ctr1;
3187                         NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_ctr1, 0xFFFFFC01, -1));
3188                         NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr1(_ndr_ctr1, NDR_SCALARS|NDR_BUFFERS, &r->ctr1));
3189                         NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_ctr1, 0xFFFFFC01, -1));
3190                 }
3191                 NDR_CHECK(ndr_pull_trailer_align(ndr, 1));
3192         }
3193         if (ndr_flags & NDR_BUFFERS) {
3194         }
3195         return NDR_ERR_SUCCESS;
3196 }
3197
3198 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCtr1TS(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr1TS *r)
3199 {
3200         ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesCtr1TS");
3201         ndr->depth++;
3202         ndr_print_drsuapi_DsGetNCChangesCtr1(ndr, "ctr1", &r->ctr1);
3203         ndr->depth--;
3204 }
3205
3206 _PUBLIC_ enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesCtr6TS(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesCtr6TS *r)
3207 {
3208         if (ndr_flags & NDR_SCALARS) {
3209                 NDR_CHECK(ndr_push_align(ndr, 1));
3210                 {
3211                         struct ndr_push *_ndr_ctr6;
3212                         NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_ctr6, 0xFFFFFC01, -1));
3213                         NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr6(_ndr_ctr6, NDR_SCALARS|NDR_BUFFERS, &r->ctr6));
3214                         NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_ctr6, 0xFFFFFC01, -1));
3215                 }
3216                 NDR_CHECK(ndr_push_trailer_align(ndr, 1));
3217         }
3218         if (ndr_flags & NDR_BUFFERS) {
3219         }
3220         return NDR_ERR_SUCCESS;
3221 }
3222
3223 _PUBLIC_ enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesCtr6TS(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesCtr6TS *r)
3224 {
3225         if (ndr_flags & NDR_SCALARS) {
3226                 NDR_CHECK(ndr_pull_align(ndr, 1));
3227                 {
3228                         struct ndr_pull *_ndr_ctr6;
3229                         NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_ctr6, 0xFFFFFC01, -1));
3230                         NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr6(_ndr_ctr6, NDR_SCALARS|NDR_BUFFERS, &r->ctr6));
3231                         NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_ctr6, 0xFFFFFC01, -1));
3232                 }
3233                 NDR_CHECK(ndr_pull_trailer_align(ndr, 1));
3234         }
3235         if (ndr_flags & NDR_BUFFERS) {
3236         }
3237         return NDR_ERR_SUCCESS;
3238 }
3239
3240 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesCtr6TS(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesCtr6TS *r)
3241 {
3242         ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesCtr6TS");
3243         ndr->depth++;
3244         ndr_print_drsuapi_DsGetNCChangesCtr6(ndr, "ctr6", &r->ctr6);
3245         ndr->depth--;
3246 }
3247
3248 static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesMSZIPCtr1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesMSZIPCtr1 *r)
3249 {
3250         uint32_t _ptr_ts;
3251         TALLOC_CTX *_mem_save_ts_0;
3252         if (ndr_flags & NDR_SCALARS) {
3253                 NDR_CHECK(ndr_pull_align(ndr, 5));
3254                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->decompressed_length));
3255                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->compressed_length));
3256                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ts));
3257                 if (_ptr_ts) {
3258                         NDR_PULL_ALLOC(ndr, r->ts);
3259                 } else {
3260                         r->ts = NULL;
3261                 }
3262                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
3263         }
3264         if (ndr_flags & NDR_BUFFERS) {
3265                 if (r->ts) {
3266                         _mem_save_ts_0 = NDR_PULL_GET_MEM_CTX(ndr);
3267                         NDR_PULL_SET_MEM_CTX(ndr, r->ts, 0);
3268                         {
3269                                 struct ndr_pull *_ndr_ts;
3270                                 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_ts, 4, r->compressed_length));
3271                                 {
3272                                         struct ndr_pull *_ndr_ts_compressed;
3273                                         NDR_CHECK(ndr_pull_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_MSZIP, r->decompressed_length));
3274                                         NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr1TS(_ndr_ts_compressed, NDR_SCALARS|NDR_BUFFERS, r->ts));
3275                                         NDR_CHECK(ndr_pull_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_MSZIP, r->decompressed_length));
3276                                 }
3277                                 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_ts, 4, r->compressed_length));
3278                         }
3279                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ts_0, 0);
3280                 }
3281         }
3282         return NDR_ERR_SUCCESS;
3283 }
3284
3285 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesMSZIPCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesMSZIPCtr1 *r)
3286 {
3287         ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesMSZIPCtr1");
3288         ndr->depth++;
3289         ndr_print_uint32(ndr, "decompressed_length", r->decompressed_length);
3290         ndr_print_uint32(ndr, "compressed_length", r->compressed_length);
3291         ndr_print_ptr(ndr, "ts", r->ts);
3292         ndr->depth++;
3293         if (r->ts) {
3294                 ndr_print_drsuapi_DsGetNCChangesCtr1TS(ndr, "ts", r->ts);
3295         }
3296         ndr->depth--;
3297         ndr->depth--;
3298 }
3299
3300 static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesMSZIPCtr6(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesMSZIPCtr6 *r)
3301 {
3302         uint32_t _ptr_ts;
3303         TALLOC_CTX *_mem_save_ts_0;
3304         if (ndr_flags & NDR_SCALARS) {
3305                 NDR_CHECK(ndr_pull_align(ndr, 5));
3306                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->decompressed_length));
3307                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->compressed_length));
3308                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ts));
3309                 if (_ptr_ts) {
3310                         NDR_PULL_ALLOC(ndr, r->ts);
3311                 } else {
3312                         r->ts = NULL;
3313                 }
3314                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
3315         }
3316         if (ndr_flags & NDR_BUFFERS) {
3317                 if (r->ts) {
3318                         _mem_save_ts_0 = NDR_PULL_GET_MEM_CTX(ndr);
3319                         NDR_PULL_SET_MEM_CTX(ndr, r->ts, 0);
3320                         {
3321                                 struct ndr_pull *_ndr_ts;
3322                                 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_ts, 4, r->compressed_length));
3323                                 {
3324                                         struct ndr_pull *_ndr_ts_compressed;
3325                                         NDR_CHECK(ndr_pull_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_MSZIP, r->decompressed_length));
3326                                         NDR_CHECK(ndr_pull_drsuapi_DsGetNCChangesCtr6TS(_ndr_ts_compressed, NDR_SCALARS|NDR_BUFFERS, r->ts));
3327                                         NDR_CHECK(ndr_pull_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_MSZIP, r->decompressed_length));
3328                                 }
3329                                 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_ts, 4, r->compressed_length));
3330                         }
3331                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ts_0, 0);
3332                 }
3333         }
3334         return NDR_ERR_SUCCESS;
3335 }
3336
3337 _PUBLIC_ void ndr_print_drsuapi_DsGetNCChangesMSZIPCtr6(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesMSZIPCtr6 *r)
3338 {
3339         ndr_print_struct(ndr, name, "drsuapi_DsGetNCChangesMSZIPCtr6");
3340         ndr->depth++;
3341         ndr_print_uint32(ndr, "decompressed_length", r->decompressed_length);
3342         ndr_print_uint32(ndr, "compressed_length", r->compressed_length);
3343         ndr_print_ptr(ndr, "ts", r->ts);
3344         ndr->depth++;
3345         if (r->ts) {
3346                 ndr_print_drsuapi_DsGetNCChangesCtr6TS(ndr, "ts", r->ts);
3347         }
3348         ndr->depth--;
3349         ndr->depth--;
3350 }
3351
3352 static enum ndr_err_code ndr_pull_drsuapi_DsGetNCChangesXPRESSCtr1(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsGetNCChangesXPRESSCtr1 *r)
3353 {
3354         uint32_t _ptr_ts;
3355         TALLOC_CTX *_mem_save_ts_0;
3356         if (ndr_flags & NDR_SCALARS) {
3357                 NDR_CHECK(ndr_pull_align(ndr, 5));
3358                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->decompressed_length));
3359                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->compressed_length));
3360                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ts));
3361                 if (_ptr_ts) {
3362                         NDR_PULL_ALLOC(ndr, r->ts);
3363                 } else {
3364                         r->ts = NULL;
3365                 }
3366                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
3367         }
3368         if (ndr_flags & NDR_BUFFERS) {
3369                 if (r->ts) {
3370                         _mem_save_ts_0 = NDR_PULL_GET_MEM_CTX(ndr);
3371                         NDR_PULL_SET_MEM_CTX(ndr, r->ts, 0);
3372                         {
3373                                 struct ndr_pull *_ndr_ts;
3374                                 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_ts, 4, r->compressed_length));