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