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