~ubuntu-branches/ubuntu/oneiric/samba/oneiric-security

« back to all changes in this revision

Viewing changes to .pc/CVE-2012-1182-2.patch/librpc/gen_ndr/ndr_dssetup.c

  • Committer: Package Import Robot
  • Author(s): Tyler Hicks
  • Date: 2012-04-12 05:28:44 UTC
  • mfrom: (147.1.1 oneiric-proposed)
  • Revision ID: package-import@ubuntu.com-20120412052844-348q6l4dcb303sdu
Tags: 2:3.5.11~dfsg-1ubuntu2.2
* SECURITY UPDATE: Unauthenticated remote code execution via
  RPC calls (LP: #978458)
  - debian/patches/CVE-2012-1182-1.patch: Fix PIDL compiler to generate code
    that uses the same value for array allocation and array length checks.
    Based on upstream patch.
  - debian/patches/CVE-2012-1182-2.patch: Regenerate PIDL generated files with
    the patched PIDL compiler
  - CVE-2012-1182

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* parser auto-generated by pidl */
 
2
 
 
3
#include "includes.h"
 
4
#include "../librpc/gen_ndr/ndr_dssetup.h"
 
5
 
 
6
#include "librpc/gen_ndr/ndr_misc.h"
 
7
static enum ndr_err_code ndr_push_dssetup_DsRole(struct ndr_push *ndr, int ndr_flags, enum dssetup_DsRole r)
 
8
{
 
9
        NDR_CHECK(ndr_push_enum_uint1632(ndr, NDR_SCALARS, r));
 
10
        return NDR_ERR_SUCCESS;
 
11
}
 
12
 
 
13
static enum ndr_err_code ndr_pull_dssetup_DsRole(struct ndr_pull *ndr, int ndr_flags, enum dssetup_DsRole *r)
 
14
{
 
15
        uint16_t v;
 
16
        NDR_CHECK(ndr_pull_enum_uint1632(ndr, NDR_SCALARS, &v));
 
17
        *r = v;
 
18
        return NDR_ERR_SUCCESS;
 
19
}
 
20
 
 
21
_PUBLIC_ void ndr_print_dssetup_DsRole(struct ndr_print *ndr, const char *name, enum dssetup_DsRole r)
 
22
{
 
23
        const char *val = NULL;
 
24
 
 
25
        switch (r) {
 
26
                case DS_ROLE_STANDALONE_WORKSTATION: val = "DS_ROLE_STANDALONE_WORKSTATION"; break;
 
27
                case DS_ROLE_MEMBER_WORKSTATION: val = "DS_ROLE_MEMBER_WORKSTATION"; break;
 
28
                case DS_ROLE_STANDALONE_SERVER: val = "DS_ROLE_STANDALONE_SERVER"; break;
 
29
                case DS_ROLE_MEMBER_SERVER: val = "DS_ROLE_MEMBER_SERVER"; break;
 
30
                case DS_ROLE_BACKUP_DC: val = "DS_ROLE_BACKUP_DC"; break;
 
31
                case DS_ROLE_PRIMARY_DC: val = "DS_ROLE_PRIMARY_DC"; break;
 
32
        }
 
33
        ndr_print_enum(ndr, name, "ENUM", val, r);
 
34
}
 
35
 
 
36
static enum ndr_err_code ndr_push_dssetup_DsRoleFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
 
37
{
 
38
        NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
 
39
        return NDR_ERR_SUCCESS;
 
40
}
 
41
 
 
42
static enum ndr_err_code ndr_pull_dssetup_DsRoleFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
 
43
{
 
44
        uint32_t v;
 
45
        NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
 
46
        *r = v;
 
47
        return NDR_ERR_SUCCESS;
 
48
}
 
49
 
 
50
_PUBLIC_ void ndr_print_dssetup_DsRoleFlags(struct ndr_print *ndr, const char *name, uint32_t r)
 
51
{
 
52
        ndr_print_uint32(ndr, name, r);
 
53
        ndr->depth++;
 
54
        ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_ROLE_PRIMARY_DS_RUNNING", DS_ROLE_PRIMARY_DS_RUNNING, r);
 
55
        ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_ROLE_PRIMARY_DS_MIXED_MODE", DS_ROLE_PRIMARY_DS_MIXED_MODE, r);
 
56
        ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_ROLE_UPGRADE_IN_PROGRESS", DS_ROLE_UPGRADE_IN_PROGRESS, r);
 
57
        ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT", DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT, r);
 
58
        ndr->depth--;
 
59
}
 
60
 
 
61
static enum ndr_err_code ndr_push_dssetup_DsRolePrimaryDomInfoBasic(struct ndr_push *ndr, int ndr_flags, const struct dssetup_DsRolePrimaryDomInfoBasic *r)
 
62
{
 
63
        if (ndr_flags & NDR_SCALARS) {
 
64
                NDR_CHECK(ndr_push_align(ndr, 5));
 
65
                NDR_CHECK(ndr_push_dssetup_DsRole(ndr, NDR_SCALARS, r->role));
 
66
                NDR_CHECK(ndr_push_dssetup_DsRoleFlags(ndr, NDR_SCALARS, r->flags));
 
67
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain));
 
68
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->dns_domain));
 
69
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->forest));
 
70
                NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->domain_guid));
 
71
                NDR_CHECK(ndr_push_trailer_align(ndr, 5));
 
72
        }
 
73
        if (ndr_flags & NDR_BUFFERS) {
 
74
                if (r->domain) {
 
75
                        NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16)));
 
76
                        NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
 
77
                        NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16)));
 
78
                        NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain, ndr_charset_length(r->domain, CH_UTF16), sizeof(uint16_t), CH_UTF16));
 
79
                }
 
80
                if (r->dns_domain) {
 
81
                        NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dns_domain, CH_UTF16)));
 
82
                        NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
 
83
                        NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->dns_domain, CH_UTF16)));
 
84
                        NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dns_domain, ndr_charset_length(r->dns_domain, CH_UTF16), sizeof(uint16_t), CH_UTF16));
 
85
                }
 
86
                if (r->forest) {
 
87
                        NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->forest, CH_UTF16)));
 
88
                        NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
 
89
                        NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->forest, CH_UTF16)));
 
90
                        NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->forest, ndr_charset_length(r->forest, CH_UTF16), sizeof(uint16_t), CH_UTF16));
 
91
                }
 
92
        }
 
93
        return NDR_ERR_SUCCESS;
 
94
}
 
95
 
 
96
static enum ndr_err_code ndr_pull_dssetup_DsRolePrimaryDomInfoBasic(struct ndr_pull *ndr, int ndr_flags, struct dssetup_DsRolePrimaryDomInfoBasic *r)
 
97
{
 
98
        uint32_t _ptr_domain;
 
99
        TALLOC_CTX *_mem_save_domain_0;
 
100
        uint32_t _ptr_dns_domain;
 
101
        TALLOC_CTX *_mem_save_dns_domain_0;
 
102
        uint32_t _ptr_forest;
 
103
        TALLOC_CTX *_mem_save_forest_0;
 
104
        if (ndr_flags & NDR_SCALARS) {
 
105
                NDR_CHECK(ndr_pull_align(ndr, 5));
 
106
                NDR_CHECK(ndr_pull_dssetup_DsRole(ndr, NDR_SCALARS, &r->role));
 
107
                NDR_CHECK(ndr_pull_dssetup_DsRoleFlags(ndr, NDR_SCALARS, &r->flags));
 
108
                NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain));
 
109
                if (_ptr_domain) {
 
110
                        NDR_PULL_ALLOC(ndr, r->domain);
 
111
                } else {
 
112
                        r->domain = NULL;
 
113
                }
 
114
                NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dns_domain));
 
115
                if (_ptr_dns_domain) {
 
116
                        NDR_PULL_ALLOC(ndr, r->dns_domain);
 
117
                } else {
 
118
                        r->dns_domain = NULL;
 
119
                }
 
120
                NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_forest));
 
121
                if (_ptr_forest) {
 
122
                        NDR_PULL_ALLOC(ndr, r->forest);
 
123
                } else {
 
124
                        r->forest = NULL;
 
125
                }
 
126
                NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->domain_guid));
 
127
                NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
 
128
        }
 
129
        if (ndr_flags & NDR_BUFFERS) {
 
130
                if (r->domain) {
 
131
                        _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr);
 
132
                        NDR_PULL_SET_MEM_CTX(ndr, r->domain, 0);
 
133
                        NDR_CHECK(ndr_pull_array_size(ndr, &r->domain));
 
134
                        NDR_CHECK(ndr_pull_array_length(ndr, &r->domain));
 
135
                        if (ndr_get_array_length(ndr, &r->domain) > ndr_get_array_size(ndr, &r->domain)) {
 
136
                                return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain), ndr_get_array_length(ndr, &r->domain));
 
137
                        }
 
138
                        NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t)));
 
139
                        NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t), CH_UTF16));
 
140
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0);
 
141
                }
 
142
                if (r->dns_domain) {
 
143
                        _mem_save_dns_domain_0 = NDR_PULL_GET_MEM_CTX(ndr);
 
144
                        NDR_PULL_SET_MEM_CTX(ndr, r->dns_domain, 0);
 
145
                        NDR_CHECK(ndr_pull_array_size(ndr, &r->dns_domain));
 
146
                        NDR_CHECK(ndr_pull_array_length(ndr, &r->dns_domain));
 
147
                        if (ndr_get_array_length(ndr, &r->dns_domain) > ndr_get_array_size(ndr, &r->dns_domain)) {
 
148
                                return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dns_domain), ndr_get_array_length(ndr, &r->dns_domain));
 
149
                        }
 
150
                        NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dns_domain), sizeof(uint16_t)));
 
151
                        NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dns_domain, ndr_get_array_length(ndr, &r->dns_domain), sizeof(uint16_t), CH_UTF16));
 
152
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dns_domain_0, 0);
 
153
                }
 
154
                if (r->forest) {
 
155
                        _mem_save_forest_0 = NDR_PULL_GET_MEM_CTX(ndr);
 
156
                        NDR_PULL_SET_MEM_CTX(ndr, r->forest, 0);
 
157
                        NDR_CHECK(ndr_pull_array_size(ndr, &r->forest));
 
158
                        NDR_CHECK(ndr_pull_array_length(ndr, &r->forest));
 
159
                        if (ndr_get_array_length(ndr, &r->forest) > ndr_get_array_size(ndr, &r->forest)) {
 
160
                                return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->forest), ndr_get_array_length(ndr, &r->forest));
 
161
                        }
 
162
                        NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->forest), sizeof(uint16_t)));
 
163
                        NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->forest, ndr_get_array_length(ndr, &r->forest), sizeof(uint16_t), CH_UTF16));
 
164
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_forest_0, 0);
 
165
                }
 
166
        }
 
167
        return NDR_ERR_SUCCESS;
 
168
}
 
169
 
 
170
_PUBLIC_ void ndr_print_dssetup_DsRolePrimaryDomInfoBasic(struct ndr_print *ndr, const char *name, const struct dssetup_DsRolePrimaryDomInfoBasic *r)
 
171
{
 
172
        ndr_print_struct(ndr, name, "dssetup_DsRolePrimaryDomInfoBasic");
 
173
        ndr->depth++;
 
174
        ndr_print_dssetup_DsRole(ndr, "role", r->role);
 
175
        ndr_print_dssetup_DsRoleFlags(ndr, "flags", r->flags);
 
176
        ndr_print_ptr(ndr, "domain", r->domain);
 
177
        ndr->depth++;
 
178
        if (r->domain) {
 
179
                ndr_print_string(ndr, "domain", r->domain);
 
180
        }
 
181
        ndr->depth--;
 
182
        ndr_print_ptr(ndr, "dns_domain", r->dns_domain);
 
183
        ndr->depth++;
 
184
        if (r->dns_domain) {
 
185
                ndr_print_string(ndr, "dns_domain", r->dns_domain);
 
186
        }
 
187
        ndr->depth--;
 
188
        ndr_print_ptr(ndr, "forest", r->forest);
 
189
        ndr->depth++;
 
190
        if (r->forest) {
 
191
                ndr_print_string(ndr, "forest", r->forest);
 
192
        }
 
193
        ndr->depth--;
 
194
        ndr_print_GUID(ndr, "domain_guid", &r->domain_guid);
 
195
        ndr->depth--;
 
196
}
 
197
 
 
198
static enum ndr_err_code ndr_push_dssetup_DsUpgrade(struct ndr_push *ndr, int ndr_flags, enum dssetup_DsUpgrade r)
 
199
{
 
200
        NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
 
201
        return NDR_ERR_SUCCESS;
 
202
}
 
203
 
 
204
static enum ndr_err_code ndr_pull_dssetup_DsUpgrade(struct ndr_pull *ndr, int ndr_flags, enum dssetup_DsUpgrade *r)
 
205
{
 
206
        uint32_t v;
 
207
        NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
 
208
        *r = v;
 
209
        return NDR_ERR_SUCCESS;
 
210
}
 
211
 
 
212
_PUBLIC_ void ndr_print_dssetup_DsUpgrade(struct ndr_print *ndr, const char *name, enum dssetup_DsUpgrade r)
 
213
{
 
214
        const char *val = NULL;
 
215
 
 
216
        switch (r) {
 
217
                case DS_ROLE_NOT_UPGRADING: val = "DS_ROLE_NOT_UPGRADING"; break;
 
218
                case DS_ROLE_UPGRADING: val = "DS_ROLE_UPGRADING"; break;
 
219
        }
 
220
        ndr_print_enum(ndr, name, "ENUM", val, r);
 
221
}
 
222
 
 
223
static enum ndr_err_code ndr_push_dssetup_DsPrevious(struct ndr_push *ndr, int ndr_flags, enum dssetup_DsPrevious r)
 
224
{
 
225
        NDR_CHECK(ndr_push_enum_uint1632(ndr, NDR_SCALARS, r));
 
226
        return NDR_ERR_SUCCESS;
 
227
}
 
228
 
 
229
static enum ndr_err_code ndr_pull_dssetup_DsPrevious(struct ndr_pull *ndr, int ndr_flags, enum dssetup_DsPrevious *r)
 
230
{
 
231
        uint16_t v;
 
232
        NDR_CHECK(ndr_pull_enum_uint1632(ndr, NDR_SCALARS, &v));
 
233
        *r = v;
 
234
        return NDR_ERR_SUCCESS;
 
235
}
 
236
 
 
237
_PUBLIC_ void ndr_print_dssetup_DsPrevious(struct ndr_print *ndr, const char *name, enum dssetup_DsPrevious r)
 
238
{
 
239
        const char *val = NULL;
 
240
 
 
241
        switch (r) {
 
242
                case DS_ROLE_PREVIOUS_UNKNOWN: val = "DS_ROLE_PREVIOUS_UNKNOWN"; break;
 
243
                case DS_ROLE_PREVIOUS_PRIMARY: val = "DS_ROLE_PREVIOUS_PRIMARY"; break;
 
244
                case DS_ROLE_PREVIOUS_BACKUP: val = "DS_ROLE_PREVIOUS_BACKUP"; break;
 
245
        }
 
246
        ndr_print_enum(ndr, name, "ENUM", val, r);
 
247
}
 
248
 
 
249
static enum ndr_err_code ndr_push_dssetup_DsRoleUpgradeStatus(struct ndr_push *ndr, int ndr_flags, const struct dssetup_DsRoleUpgradeStatus *r)
 
250
{
 
251
        if (ndr_flags & NDR_SCALARS) {
 
252
                NDR_CHECK(ndr_push_align(ndr, 4));
 
253
                NDR_CHECK(ndr_push_dssetup_DsUpgrade(ndr, NDR_SCALARS, r->upgrading));
 
254
                NDR_CHECK(ndr_push_dssetup_DsPrevious(ndr, NDR_SCALARS, r->previous_role));
 
255
                NDR_CHECK(ndr_push_trailer_align(ndr, 4));
 
256
        }
 
257
        if (ndr_flags & NDR_BUFFERS) {
 
258
        }
 
259
        return NDR_ERR_SUCCESS;
 
260
}
 
261
 
 
262
static enum ndr_err_code ndr_pull_dssetup_DsRoleUpgradeStatus(struct ndr_pull *ndr, int ndr_flags, struct dssetup_DsRoleUpgradeStatus *r)
 
263
{
 
264
        if (ndr_flags & NDR_SCALARS) {
 
265
                NDR_CHECK(ndr_pull_align(ndr, 4));
 
266
                NDR_CHECK(ndr_pull_dssetup_DsUpgrade(ndr, NDR_SCALARS, &r->upgrading));
 
267
                NDR_CHECK(ndr_pull_dssetup_DsPrevious(ndr, NDR_SCALARS, &r->previous_role));
 
268
                NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
 
269
        }
 
270
        if (ndr_flags & NDR_BUFFERS) {
 
271
        }
 
272
        return NDR_ERR_SUCCESS;
 
273
}
 
274
 
 
275
_PUBLIC_ void ndr_print_dssetup_DsRoleUpgradeStatus(struct ndr_print *ndr, const char *name, const struct dssetup_DsRoleUpgradeStatus *r)
 
276
{
 
277
        ndr_print_struct(ndr, name, "dssetup_DsRoleUpgradeStatus");
 
278
        ndr->depth++;
 
279
        ndr_print_dssetup_DsUpgrade(ndr, "upgrading", r->upgrading);
 
280
        ndr_print_dssetup_DsPrevious(ndr, "previous_role", r->previous_role);
 
281
        ndr->depth--;
 
282
}
 
283
 
 
284
static enum ndr_err_code ndr_push_dssetup_DsRoleOp(struct ndr_push *ndr, int ndr_flags, enum dssetup_DsRoleOp r)
 
285
{
 
286
        NDR_CHECK(ndr_push_enum_uint1632(ndr, NDR_SCALARS, r));
 
287
        return NDR_ERR_SUCCESS;
 
288
}
 
289
 
 
290
static enum ndr_err_code ndr_pull_dssetup_DsRoleOp(struct ndr_pull *ndr, int ndr_flags, enum dssetup_DsRoleOp *r)
 
291
{
 
292
        uint16_t v;
 
293
        NDR_CHECK(ndr_pull_enum_uint1632(ndr, NDR_SCALARS, &v));
 
294
        *r = v;
 
295
        return NDR_ERR_SUCCESS;
 
296
}
 
297
 
 
298
_PUBLIC_ void ndr_print_dssetup_DsRoleOp(struct ndr_print *ndr, const char *name, enum dssetup_DsRoleOp r)
 
299
{
 
300
        const char *val = NULL;
 
301
 
 
302
        switch (r) {
 
303
                case DS_ROLE_OP_IDLE: val = "DS_ROLE_OP_IDLE"; break;
 
304
                case DS_ROLE_OP_ACTIVE: val = "DS_ROLE_OP_ACTIVE"; break;
 
305
                case DS_ROLE_OP_NEEDS_REBOOT: val = "DS_ROLE_OP_NEEDS_REBOOT"; break;
 
306
        }
 
307
        ndr_print_enum(ndr, name, "ENUM", val, r);
 
308
}
 
309
 
 
310
static enum ndr_err_code ndr_push_dssetup_DsRoleOpStatus(struct ndr_push *ndr, int ndr_flags, const struct dssetup_DsRoleOpStatus *r)
 
311
{
 
312
        if (ndr_flags & NDR_SCALARS) {
 
313
                NDR_CHECK(ndr_push_align(ndr, 3));
 
314
                NDR_CHECK(ndr_push_dssetup_DsRoleOp(ndr, NDR_SCALARS, r->status));
 
315
                NDR_CHECK(ndr_push_trailer_align(ndr, 3));
 
316
        }
 
317
        if (ndr_flags & NDR_BUFFERS) {
 
318
        }
 
319
        return NDR_ERR_SUCCESS;
 
320
}
 
321
 
 
322
static enum ndr_err_code ndr_pull_dssetup_DsRoleOpStatus(struct ndr_pull *ndr, int ndr_flags, struct dssetup_DsRoleOpStatus *r)
 
323
{
 
324
        if (ndr_flags & NDR_SCALARS) {
 
325
                NDR_CHECK(ndr_pull_align(ndr, 3));
 
326
                NDR_CHECK(ndr_pull_dssetup_DsRoleOp(ndr, NDR_SCALARS, &r->status));
 
327
                NDR_CHECK(ndr_pull_trailer_align(ndr, 3));
 
328
        }
 
329
        if (ndr_flags & NDR_BUFFERS) {
 
330
        }
 
331
        return NDR_ERR_SUCCESS;
 
332
}
 
333
 
 
334
_PUBLIC_ void ndr_print_dssetup_DsRoleOpStatus(struct ndr_print *ndr, const char *name, const struct dssetup_DsRoleOpStatus *r)
 
335
{
 
336
        ndr_print_struct(ndr, name, "dssetup_DsRoleOpStatus");
 
337
        ndr->depth++;
 
338
        ndr_print_dssetup_DsRoleOp(ndr, "status", r->status);
 
339
        ndr->depth--;
 
340
}
 
341
 
 
342
static enum ndr_err_code ndr_push_dssetup_DsRoleInfoLevel(struct ndr_push *ndr, int ndr_flags, enum dssetup_DsRoleInfoLevel r)
 
343
{
 
344
        NDR_CHECK(ndr_push_enum_uint1632(ndr, NDR_SCALARS, r));
 
345
        return NDR_ERR_SUCCESS;
 
346
}
 
347
 
 
348
static enum ndr_err_code ndr_pull_dssetup_DsRoleInfoLevel(struct ndr_pull *ndr, int ndr_flags, enum dssetup_DsRoleInfoLevel *r)
 
349
{
 
350
        uint16_t v;
 
351
        NDR_CHECK(ndr_pull_enum_uint1632(ndr, NDR_SCALARS, &v));
 
352
        *r = v;
 
353
        return NDR_ERR_SUCCESS;
 
354
}
 
355
 
 
356
_PUBLIC_ void ndr_print_dssetup_DsRoleInfoLevel(struct ndr_print *ndr, const char *name, enum dssetup_DsRoleInfoLevel r)
 
357
{
 
358
        const char *val = NULL;
 
359
 
 
360
        switch (r) {
 
361
                case DS_ROLE_BASIC_INFORMATION: val = "DS_ROLE_BASIC_INFORMATION"; break;
 
362
                case DS_ROLE_UPGRADE_STATUS: val = "DS_ROLE_UPGRADE_STATUS"; break;
 
363
                case DS_ROLE_OP_STATUS: val = "DS_ROLE_OP_STATUS"; break;
 
364
        }
 
365
        ndr_print_enum(ndr, name, "ENUM", val, r);
 
366
}
 
367
 
 
368
static enum ndr_err_code ndr_push_dssetup_DsRoleInfo(struct ndr_push *ndr, int ndr_flags, const union dssetup_DsRoleInfo *r)
 
369
{
 
370
        if (ndr_flags & NDR_SCALARS) {
 
371
                int level = ndr_push_get_switch_value(ndr, r);
 
372
                NDR_CHECK(ndr_push_dssetup_DsRoleInfoLevel(ndr, NDR_SCALARS, level));
 
373
                NDR_CHECK(ndr_push_union_align(ndr, 5));
 
374
                switch (level) {
 
375
                        case DS_ROLE_BASIC_INFORMATION: {
 
376
                                NDR_CHECK(ndr_push_dssetup_DsRolePrimaryDomInfoBasic(ndr, NDR_SCALARS, &r->basic));
 
377
                        break; }
 
378
 
 
379
                        case DS_ROLE_UPGRADE_STATUS: {
 
380
                                NDR_CHECK(ndr_push_dssetup_DsRoleUpgradeStatus(ndr, NDR_SCALARS, &r->upgrade));
 
381
                        break; }
 
382
 
 
383
                        case DS_ROLE_OP_STATUS: {
 
384
                                NDR_CHECK(ndr_push_dssetup_DsRoleOpStatus(ndr, NDR_SCALARS, &r->opstatus));
 
385
                        break; }
 
386
 
 
387
                        default:
 
388
                                return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
 
389
                }
 
390
        }
 
391
        if (ndr_flags & NDR_BUFFERS) {
 
392
                int level = ndr_push_get_switch_value(ndr, r);
 
393
                switch (level) {
 
394
                        case DS_ROLE_BASIC_INFORMATION:
 
395
                                NDR_CHECK(ndr_push_dssetup_DsRolePrimaryDomInfoBasic(ndr, NDR_BUFFERS, &r->basic));
 
396
                        break;
 
397
 
 
398
                        case DS_ROLE_UPGRADE_STATUS:
 
399
                        break;
 
400
 
 
401
                        case DS_ROLE_OP_STATUS:
 
402
                        break;
 
403
 
 
404
                        default:
 
405
                                return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
 
406
                }
 
407
        }
 
408
        return NDR_ERR_SUCCESS;
 
409
}
 
410
 
 
411
static enum ndr_err_code ndr_pull_dssetup_DsRoleInfo(struct ndr_pull *ndr, int ndr_flags, union dssetup_DsRoleInfo *r)
 
412
{
 
413
        int level;
 
414
        uint16_t _level;
 
415
        level = ndr_pull_get_switch_value(ndr, r);
 
416
        if (ndr_flags & NDR_SCALARS) {
 
417
                NDR_CHECK(ndr_pull_uint1632(ndr, NDR_SCALARS, &_level));
 
418
                if (_level != level) {
 
419
                        return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
 
420
                }
 
421
                NDR_CHECK(ndr_pull_union_align(ndr, 5));
 
422
                switch (level) {
 
423
                        case DS_ROLE_BASIC_INFORMATION: {
 
424
                                NDR_CHECK(ndr_pull_dssetup_DsRolePrimaryDomInfoBasic(ndr, NDR_SCALARS, &r->basic));
 
425
                        break; }
 
426
 
 
427
                        case DS_ROLE_UPGRADE_STATUS: {
 
428
                                NDR_CHECK(ndr_pull_dssetup_DsRoleUpgradeStatus(ndr, NDR_SCALARS, &r->upgrade));
 
429
                        break; }
 
430
 
 
431
                        case DS_ROLE_OP_STATUS: {
 
432
                                NDR_CHECK(ndr_pull_dssetup_DsRoleOpStatus(ndr, NDR_SCALARS, &r->opstatus));
 
433
                        break; }
 
434
 
 
435
                        default:
 
436
                                return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
 
437
                }
 
438
        }
 
439
        if (ndr_flags & NDR_BUFFERS) {
 
440
                switch (level) {
 
441
                        case DS_ROLE_BASIC_INFORMATION:
 
442
                                NDR_CHECK(ndr_pull_dssetup_DsRolePrimaryDomInfoBasic(ndr, NDR_BUFFERS, &r->basic));
 
443
                        break;
 
444
 
 
445
                        case DS_ROLE_UPGRADE_STATUS:
 
446
                        break;
 
447
 
 
448
                        case DS_ROLE_OP_STATUS:
 
449
                        break;
 
450
 
 
451
                        default:
 
452
                                return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
 
453
                }
 
454
        }
 
455
        return NDR_ERR_SUCCESS;
 
456
}
 
457
 
 
458
_PUBLIC_ void ndr_print_dssetup_DsRoleInfo(struct ndr_print *ndr, const char *name, const union dssetup_DsRoleInfo *r)
 
459
{
 
460
        int level;
 
461
        level = ndr_print_get_switch_value(ndr, r);
 
462
        ndr_print_union(ndr, name, level, "dssetup_DsRoleInfo");
 
463
        switch (level) {
 
464
                case DS_ROLE_BASIC_INFORMATION:
 
465
                        ndr_print_dssetup_DsRolePrimaryDomInfoBasic(ndr, "basic", &r->basic);
 
466
                break;
 
467
 
 
468
                case DS_ROLE_UPGRADE_STATUS:
 
469
                        ndr_print_dssetup_DsRoleUpgradeStatus(ndr, "upgrade", &r->upgrade);
 
470
                break;
 
471
 
 
472
                case DS_ROLE_OP_STATUS:
 
473
                        ndr_print_dssetup_DsRoleOpStatus(ndr, "opstatus", &r->opstatus);
 
474
                break;
 
475
 
 
476
                default:
 
477
                        ndr_print_bad_level(ndr, name, level);
 
478
        }
 
479
}
 
480
 
 
481
static enum ndr_err_code ndr_push_dssetup_DsRoleGetPrimaryDomainInformation(struct ndr_push *ndr, int flags, const struct dssetup_DsRoleGetPrimaryDomainInformation *r)
 
482
{
 
483
        if (flags & NDR_IN) {
 
484
                NDR_CHECK(ndr_push_dssetup_DsRoleInfoLevel(ndr, NDR_SCALARS, r->in.level));
 
485
        }
 
486
        if (flags & NDR_OUT) {
 
487
                NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.info));
 
488
                if (r->out.info) {
 
489
                        NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.info, r->in.level));
 
490
                        NDR_CHECK(ndr_push_dssetup_DsRoleInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info));
 
491
                }
 
492
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
 
493
        }
 
494
        return NDR_ERR_SUCCESS;
 
495
}
 
496
 
 
497
static enum ndr_err_code ndr_pull_dssetup_DsRoleGetPrimaryDomainInformation(struct ndr_pull *ndr, int flags, struct dssetup_DsRoleGetPrimaryDomainInformation *r)
 
498
{
 
499
        uint32_t _ptr_info;
 
500
        TALLOC_CTX *_mem_save_info_0;
 
501
        if (flags & NDR_IN) {
 
502
                ZERO_STRUCT(r->out);
 
503
 
 
504
                NDR_CHECK(ndr_pull_dssetup_DsRoleInfoLevel(ndr, NDR_SCALARS, &r->in.level));
 
505
        }
 
506
        if (flags & NDR_OUT) {
 
507
                NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info));
 
508
                if (_ptr_info) {
 
509
                        NDR_PULL_ALLOC(ndr, r->out.info);
 
510
                } else {
 
511
                        r->out.info = NULL;
 
512
                }
 
513
                if (r->out.info) {
 
514
                        _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
 
515
                        NDR_PULL_SET_MEM_CTX(ndr, r->out.info, 0);
 
516
                        NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level));
 
517
                        NDR_CHECK(ndr_pull_dssetup_DsRoleInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info));
 
518
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0);
 
519
                }
 
520
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
 
521
        }
 
522
        return NDR_ERR_SUCCESS;
 
523
}
 
524
 
 
525
_PUBLIC_ void ndr_print_dssetup_DsRoleGetPrimaryDomainInformation(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleGetPrimaryDomainInformation *r)
 
526
{
 
527
        ndr_print_struct(ndr, name, "dssetup_DsRoleGetPrimaryDomainInformation");
 
528
        ndr->depth++;
 
529
        if (flags & NDR_SET_VALUES) {
 
530
                ndr->flags |= LIBNDR_PRINT_SET_VALUES;
 
531
        }
 
532
        if (flags & NDR_IN) {
 
533
                ndr_print_struct(ndr, "in", "dssetup_DsRoleGetPrimaryDomainInformation");
 
534
                ndr->depth++;
 
535
                ndr_print_dssetup_DsRoleInfoLevel(ndr, "level", r->in.level);
 
536
                ndr->depth--;
 
537
        }
 
538
        if (flags & NDR_OUT) {
 
539
                ndr_print_struct(ndr, "out", "dssetup_DsRoleGetPrimaryDomainInformation");
 
540
                ndr->depth++;
 
541
                ndr_print_ptr(ndr, "info", r->out.info);
 
542
                ndr->depth++;
 
543
                if (r->out.info) {
 
544
                        ndr_print_set_switch_value(ndr, r->out.info, r->in.level);
 
545
                        ndr_print_dssetup_DsRoleInfo(ndr, "info", r->out.info);
 
546
                }
 
547
                ndr->depth--;
 
548
                ndr_print_WERROR(ndr, "result", r->out.result);
 
549
                ndr->depth--;
 
550
        }
 
551
        ndr->depth--;
 
552
}
 
553
 
 
554
static enum ndr_err_code ndr_push_dssetup_DsRoleDnsNameToFlatName(struct ndr_push *ndr, int flags, const struct dssetup_DsRoleDnsNameToFlatName *r)
 
555
{
 
556
        if (flags & NDR_IN) {
 
557
        }
 
558
        if (flags & NDR_OUT) {
 
559
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
 
560
        }
 
561
        return NDR_ERR_SUCCESS;
 
562
}
 
563
 
 
564
static enum ndr_err_code ndr_pull_dssetup_DsRoleDnsNameToFlatName(struct ndr_pull *ndr, int flags, struct dssetup_DsRoleDnsNameToFlatName *r)
 
565
{
 
566
        if (flags & NDR_IN) {
 
567
        }
 
568
        if (flags & NDR_OUT) {
 
569
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
 
570
        }
 
571
        return NDR_ERR_SUCCESS;
 
572
}
 
573
 
 
574
_PUBLIC_ void ndr_print_dssetup_DsRoleDnsNameToFlatName(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleDnsNameToFlatName *r)
 
575
{
 
576
        ndr_print_struct(ndr, name, "dssetup_DsRoleDnsNameToFlatName");
 
577
        ndr->depth++;
 
578
        if (flags & NDR_SET_VALUES) {
 
579
                ndr->flags |= LIBNDR_PRINT_SET_VALUES;
 
580
        }
 
581
        if (flags & NDR_IN) {
 
582
                ndr_print_struct(ndr, "in", "dssetup_DsRoleDnsNameToFlatName");
 
583
                ndr->depth++;
 
584
                ndr->depth--;
 
585
        }
 
586
        if (flags & NDR_OUT) {
 
587
                ndr_print_struct(ndr, "out", "dssetup_DsRoleDnsNameToFlatName");
 
588
                ndr->depth++;
 
589
                ndr_print_WERROR(ndr, "result", r->out.result);
 
590
                ndr->depth--;
 
591
        }
 
592
        ndr->depth--;
 
593
}
 
594
 
 
595
static enum ndr_err_code ndr_push_dssetup_DsRoleDcAsDc(struct ndr_push *ndr, int flags, const struct dssetup_DsRoleDcAsDc *r)
 
596
{
 
597
        if (flags & NDR_IN) {
 
598
        }
 
599
        if (flags & NDR_OUT) {
 
600
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
 
601
        }
 
602
        return NDR_ERR_SUCCESS;
 
603
}
 
604
 
 
605
static enum ndr_err_code ndr_pull_dssetup_DsRoleDcAsDc(struct ndr_pull *ndr, int flags, struct dssetup_DsRoleDcAsDc *r)
 
606
{
 
607
        if (flags & NDR_IN) {
 
608
        }
 
609
        if (flags & NDR_OUT) {
 
610
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
 
611
        }
 
612
        return NDR_ERR_SUCCESS;
 
613
}
 
614
 
 
615
_PUBLIC_ void ndr_print_dssetup_DsRoleDcAsDc(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleDcAsDc *r)
 
616
{
 
617
        ndr_print_struct(ndr, name, "dssetup_DsRoleDcAsDc");
 
618
        ndr->depth++;
 
619
        if (flags & NDR_SET_VALUES) {
 
620
                ndr->flags |= LIBNDR_PRINT_SET_VALUES;
 
621
        }
 
622
        if (flags & NDR_IN) {
 
623
                ndr_print_struct(ndr, "in", "dssetup_DsRoleDcAsDc");
 
624
                ndr->depth++;
 
625
                ndr->depth--;
 
626
        }
 
627
        if (flags & NDR_OUT) {
 
628
                ndr_print_struct(ndr, "out", "dssetup_DsRoleDcAsDc");
 
629
                ndr->depth++;
 
630
                ndr_print_WERROR(ndr, "result", r->out.result);
 
631
                ndr->depth--;
 
632
        }
 
633
        ndr->depth--;
 
634
}
 
635
 
 
636
static enum ndr_err_code ndr_push_dssetup_DsRoleDcAsReplica(struct ndr_push *ndr, int flags, const struct dssetup_DsRoleDcAsReplica *r)
 
637
{
 
638
        if (flags & NDR_IN) {
 
639
        }
 
640
        if (flags & NDR_OUT) {
 
641
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
 
642
        }
 
643
        return NDR_ERR_SUCCESS;
 
644
}
 
645
 
 
646
static enum ndr_err_code ndr_pull_dssetup_DsRoleDcAsReplica(struct ndr_pull *ndr, int flags, struct dssetup_DsRoleDcAsReplica *r)
 
647
{
 
648
        if (flags & NDR_IN) {
 
649
        }
 
650
        if (flags & NDR_OUT) {
 
651
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
 
652
        }
 
653
        return NDR_ERR_SUCCESS;
 
654
}
 
655
 
 
656
_PUBLIC_ void ndr_print_dssetup_DsRoleDcAsReplica(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleDcAsReplica *r)
 
657
{
 
658
        ndr_print_struct(ndr, name, "dssetup_DsRoleDcAsReplica");
 
659
        ndr->depth++;
 
660
        if (flags & NDR_SET_VALUES) {
 
661
                ndr->flags |= LIBNDR_PRINT_SET_VALUES;
 
662
        }
 
663
        if (flags & NDR_IN) {
 
664
                ndr_print_struct(ndr, "in", "dssetup_DsRoleDcAsReplica");
 
665
                ndr->depth++;
 
666
                ndr->depth--;
 
667
        }
 
668
        if (flags & NDR_OUT) {
 
669
                ndr_print_struct(ndr, "out", "dssetup_DsRoleDcAsReplica");
 
670
                ndr->depth++;
 
671
                ndr_print_WERROR(ndr, "result", r->out.result);
 
672
                ndr->depth--;
 
673
        }
 
674
        ndr->depth--;
 
675
}
 
676
 
 
677
static enum ndr_err_code ndr_push_dssetup_DsRoleDemoteDc(struct ndr_push *ndr, int flags, const struct dssetup_DsRoleDemoteDc *r)
 
678
{
 
679
        if (flags & NDR_IN) {
 
680
        }
 
681
        if (flags & NDR_OUT) {
 
682
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
 
683
        }
 
684
        return NDR_ERR_SUCCESS;
 
685
}
 
686
 
 
687
static enum ndr_err_code ndr_pull_dssetup_DsRoleDemoteDc(struct ndr_pull *ndr, int flags, struct dssetup_DsRoleDemoteDc *r)
 
688
{
 
689
        if (flags & NDR_IN) {
 
690
        }
 
691
        if (flags & NDR_OUT) {
 
692
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
 
693
        }
 
694
        return NDR_ERR_SUCCESS;
 
695
}
 
696
 
 
697
_PUBLIC_ void ndr_print_dssetup_DsRoleDemoteDc(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleDemoteDc *r)
 
698
{
 
699
        ndr_print_struct(ndr, name, "dssetup_DsRoleDemoteDc");
 
700
        ndr->depth++;
 
701
        if (flags & NDR_SET_VALUES) {
 
702
                ndr->flags |= LIBNDR_PRINT_SET_VALUES;
 
703
        }
 
704
        if (flags & NDR_IN) {
 
705
                ndr_print_struct(ndr, "in", "dssetup_DsRoleDemoteDc");
 
706
                ndr->depth++;
 
707
                ndr->depth--;
 
708
        }
 
709
        if (flags & NDR_OUT) {
 
710
                ndr_print_struct(ndr, "out", "dssetup_DsRoleDemoteDc");
 
711
                ndr->depth++;
 
712
                ndr_print_WERROR(ndr, "result", r->out.result);
 
713
                ndr->depth--;
 
714
        }
 
715
        ndr->depth--;
 
716
}
 
717
 
 
718
static enum ndr_err_code ndr_push_dssetup_DsRoleGetDcOperationProgress(struct ndr_push *ndr, int flags, const struct dssetup_DsRoleGetDcOperationProgress *r)
 
719
{
 
720
        if (flags & NDR_IN) {
 
721
        }
 
722
        if (flags & NDR_OUT) {
 
723
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
 
724
        }
 
725
        return NDR_ERR_SUCCESS;
 
726
}
 
727
 
 
728
static enum ndr_err_code ndr_pull_dssetup_DsRoleGetDcOperationProgress(struct ndr_pull *ndr, int flags, struct dssetup_DsRoleGetDcOperationProgress *r)
 
729
{
 
730
        if (flags & NDR_IN) {
 
731
        }
 
732
        if (flags & NDR_OUT) {
 
733
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
 
734
        }
 
735
        return NDR_ERR_SUCCESS;
 
736
}
 
737
 
 
738
_PUBLIC_ void ndr_print_dssetup_DsRoleGetDcOperationProgress(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleGetDcOperationProgress *r)
 
739
{
 
740
        ndr_print_struct(ndr, name, "dssetup_DsRoleGetDcOperationProgress");
 
741
        ndr->depth++;
 
742
        if (flags & NDR_SET_VALUES) {
 
743
                ndr->flags |= LIBNDR_PRINT_SET_VALUES;
 
744
        }
 
745
        if (flags & NDR_IN) {
 
746
                ndr_print_struct(ndr, "in", "dssetup_DsRoleGetDcOperationProgress");
 
747
                ndr->depth++;
 
748
                ndr->depth--;
 
749
        }
 
750
        if (flags & NDR_OUT) {
 
751
                ndr_print_struct(ndr, "out", "dssetup_DsRoleGetDcOperationProgress");
 
752
                ndr->depth++;
 
753
                ndr_print_WERROR(ndr, "result", r->out.result);
 
754
                ndr->depth--;
 
755
        }
 
756
        ndr->depth--;
 
757
}
 
758
 
 
759
static enum ndr_err_code ndr_push_dssetup_DsRoleGetDcOperationResults(struct ndr_push *ndr, int flags, const struct dssetup_DsRoleGetDcOperationResults *r)
 
760
{
 
761
        if (flags & NDR_IN) {
 
762
        }
 
763
        if (flags & NDR_OUT) {
 
764
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
 
765
        }
 
766
        return NDR_ERR_SUCCESS;
 
767
}
 
768
 
 
769
static enum ndr_err_code ndr_pull_dssetup_DsRoleGetDcOperationResults(struct ndr_pull *ndr, int flags, struct dssetup_DsRoleGetDcOperationResults *r)
 
770
{
 
771
        if (flags & NDR_IN) {
 
772
        }
 
773
        if (flags & NDR_OUT) {
 
774
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
 
775
        }
 
776
        return NDR_ERR_SUCCESS;
 
777
}
 
778
 
 
779
_PUBLIC_ void ndr_print_dssetup_DsRoleGetDcOperationResults(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleGetDcOperationResults *r)
 
780
{
 
781
        ndr_print_struct(ndr, name, "dssetup_DsRoleGetDcOperationResults");
 
782
        ndr->depth++;
 
783
        if (flags & NDR_SET_VALUES) {
 
784
                ndr->flags |= LIBNDR_PRINT_SET_VALUES;
 
785
        }
 
786
        if (flags & NDR_IN) {
 
787
                ndr_print_struct(ndr, "in", "dssetup_DsRoleGetDcOperationResults");
 
788
                ndr->depth++;
 
789
                ndr->depth--;
 
790
        }
 
791
        if (flags & NDR_OUT) {
 
792
                ndr_print_struct(ndr, "out", "dssetup_DsRoleGetDcOperationResults");
 
793
                ndr->depth++;
 
794
                ndr_print_WERROR(ndr, "result", r->out.result);
 
795
                ndr->depth--;
 
796
        }
 
797
        ndr->depth--;
 
798
}
 
799
 
 
800
static enum ndr_err_code ndr_push_dssetup_DsRoleCancel(struct ndr_push *ndr, int flags, const struct dssetup_DsRoleCancel *r)
 
801
{
 
802
        if (flags & NDR_IN) {
 
803
        }
 
804
        if (flags & NDR_OUT) {
 
805
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
 
806
        }
 
807
        return NDR_ERR_SUCCESS;
 
808
}
 
809
 
 
810
static enum ndr_err_code ndr_pull_dssetup_DsRoleCancel(struct ndr_pull *ndr, int flags, struct dssetup_DsRoleCancel *r)
 
811
{
 
812
        if (flags & NDR_IN) {
 
813
        }
 
814
        if (flags & NDR_OUT) {
 
815
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
 
816
        }
 
817
        return NDR_ERR_SUCCESS;
 
818
}
 
819
 
 
820
_PUBLIC_ void ndr_print_dssetup_DsRoleCancel(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleCancel *r)
 
821
{
 
822
        ndr_print_struct(ndr, name, "dssetup_DsRoleCancel");
 
823
        ndr->depth++;
 
824
        if (flags & NDR_SET_VALUES) {
 
825
                ndr->flags |= LIBNDR_PRINT_SET_VALUES;
 
826
        }
 
827
        if (flags & NDR_IN) {
 
828
                ndr_print_struct(ndr, "in", "dssetup_DsRoleCancel");
 
829
                ndr->depth++;
 
830
                ndr->depth--;
 
831
        }
 
832
        if (flags & NDR_OUT) {
 
833
                ndr_print_struct(ndr, "out", "dssetup_DsRoleCancel");
 
834
                ndr->depth++;
 
835
                ndr_print_WERROR(ndr, "result", r->out.result);
 
836
                ndr->depth--;
 
837
        }
 
838
        ndr->depth--;
 
839
}
 
840
 
 
841
static enum ndr_err_code ndr_push_dssetup_DsRoleServerSaveStateForUpgrade(struct ndr_push *ndr, int flags, const struct dssetup_DsRoleServerSaveStateForUpgrade *r)
 
842
{
 
843
        if (flags & NDR_IN) {
 
844
        }
 
845
        if (flags & NDR_OUT) {
 
846
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
 
847
        }
 
848
        return NDR_ERR_SUCCESS;
 
849
}
 
850
 
 
851
static enum ndr_err_code ndr_pull_dssetup_DsRoleServerSaveStateForUpgrade(struct ndr_pull *ndr, int flags, struct dssetup_DsRoleServerSaveStateForUpgrade *r)
 
852
{
 
853
        if (flags & NDR_IN) {
 
854
        }
 
855
        if (flags & NDR_OUT) {
 
856
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
 
857
        }
 
858
        return NDR_ERR_SUCCESS;
 
859
}
 
860
 
 
861
_PUBLIC_ void ndr_print_dssetup_DsRoleServerSaveStateForUpgrade(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleServerSaveStateForUpgrade *r)
 
862
{
 
863
        ndr_print_struct(ndr, name, "dssetup_DsRoleServerSaveStateForUpgrade");
 
864
        ndr->depth++;
 
865
        if (flags & NDR_SET_VALUES) {
 
866
                ndr->flags |= LIBNDR_PRINT_SET_VALUES;
 
867
        }
 
868
        if (flags & NDR_IN) {
 
869
                ndr_print_struct(ndr, "in", "dssetup_DsRoleServerSaveStateForUpgrade");
 
870
                ndr->depth++;
 
871
                ndr->depth--;
 
872
        }
 
873
        if (flags & NDR_OUT) {
 
874
                ndr_print_struct(ndr, "out", "dssetup_DsRoleServerSaveStateForUpgrade");
 
875
                ndr->depth++;
 
876
                ndr_print_WERROR(ndr, "result", r->out.result);
 
877
                ndr->depth--;
 
878
        }
 
879
        ndr->depth--;
 
880
}
 
881
 
 
882
static enum ndr_err_code ndr_push_dssetup_DsRoleUpgradeDownlevelServer(struct ndr_push *ndr, int flags, const struct dssetup_DsRoleUpgradeDownlevelServer *r)
 
883
{
 
884
        if (flags & NDR_IN) {
 
885
        }
 
886
        if (flags & NDR_OUT) {
 
887
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
 
888
        }
 
889
        return NDR_ERR_SUCCESS;
 
890
}
 
891
 
 
892
static enum ndr_err_code ndr_pull_dssetup_DsRoleUpgradeDownlevelServer(struct ndr_pull *ndr, int flags, struct dssetup_DsRoleUpgradeDownlevelServer *r)
 
893
{
 
894
        if (flags & NDR_IN) {
 
895
        }
 
896
        if (flags & NDR_OUT) {
 
897
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
 
898
        }
 
899
        return NDR_ERR_SUCCESS;
 
900
}
 
901
 
 
902
_PUBLIC_ void ndr_print_dssetup_DsRoleUpgradeDownlevelServer(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleUpgradeDownlevelServer *r)
 
903
{
 
904
        ndr_print_struct(ndr, name, "dssetup_DsRoleUpgradeDownlevelServer");
 
905
        ndr->depth++;
 
906
        if (flags & NDR_SET_VALUES) {
 
907
                ndr->flags |= LIBNDR_PRINT_SET_VALUES;
 
908
        }
 
909
        if (flags & NDR_IN) {
 
910
                ndr_print_struct(ndr, "in", "dssetup_DsRoleUpgradeDownlevelServer");
 
911
                ndr->depth++;
 
912
                ndr->depth--;
 
913
        }
 
914
        if (flags & NDR_OUT) {
 
915
                ndr_print_struct(ndr, "out", "dssetup_DsRoleUpgradeDownlevelServer");
 
916
                ndr->depth++;
 
917
                ndr_print_WERROR(ndr, "result", r->out.result);
 
918
                ndr->depth--;
 
919
        }
 
920
        ndr->depth--;
 
921
}
 
922
 
 
923
static enum ndr_err_code ndr_push_dssetup_DsRoleAbortDownlevelServerUpgrade(struct ndr_push *ndr, int flags, const struct dssetup_DsRoleAbortDownlevelServerUpgrade *r)
 
924
{
 
925
        if (flags & NDR_IN) {
 
926
        }
 
927
        if (flags & NDR_OUT) {
 
928
                NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
 
929
        }
 
930
        return NDR_ERR_SUCCESS;
 
931
}
 
932
 
 
933
static enum ndr_err_code ndr_pull_dssetup_DsRoleAbortDownlevelServerUpgrade(struct ndr_pull *ndr, int flags, struct dssetup_DsRoleAbortDownlevelServerUpgrade *r)
 
934
{
 
935
        if (flags & NDR_IN) {
 
936
        }
 
937
        if (flags & NDR_OUT) {
 
938
                NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
 
939
        }
 
940
        return NDR_ERR_SUCCESS;
 
941
}
 
942
 
 
943
_PUBLIC_ void ndr_print_dssetup_DsRoleAbortDownlevelServerUpgrade(struct ndr_print *ndr, const char *name, int flags, const struct dssetup_DsRoleAbortDownlevelServerUpgrade *r)
 
944
{
 
945
        ndr_print_struct(ndr, name, "dssetup_DsRoleAbortDownlevelServerUpgrade");
 
946
        ndr->depth++;
 
947
        if (flags & NDR_SET_VALUES) {
 
948
                ndr->flags |= LIBNDR_PRINT_SET_VALUES;
 
949
        }
 
950
        if (flags & NDR_IN) {
 
951
                ndr_print_struct(ndr, "in", "dssetup_DsRoleAbortDownlevelServerUpgrade");
 
952
                ndr->depth++;
 
953
                ndr->depth--;
 
954
        }
 
955
        if (flags & NDR_OUT) {
 
956
                ndr_print_struct(ndr, "out", "dssetup_DsRoleAbortDownlevelServerUpgrade");
 
957
                ndr->depth++;
 
958
                ndr_print_WERROR(ndr, "result", r->out.result);
 
959
                ndr->depth--;
 
960
        }
 
961
        ndr->depth--;
 
962
}
 
963
 
 
964
static const struct ndr_interface_call dssetup_calls[] = {
 
965
        {
 
966
                "dssetup_DsRoleGetPrimaryDomainInformation",
 
967
                sizeof(struct dssetup_DsRoleGetPrimaryDomainInformation),
 
968
                (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleGetPrimaryDomainInformation,
 
969
                (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleGetPrimaryDomainInformation,
 
970
                (ndr_print_function_t) ndr_print_dssetup_DsRoleGetPrimaryDomainInformation,
 
971
                false,
 
972
        },
 
973
        {
 
974
                "dssetup_DsRoleDnsNameToFlatName",
 
975
                sizeof(struct dssetup_DsRoleDnsNameToFlatName),
 
976
                (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleDnsNameToFlatName,
 
977
                (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleDnsNameToFlatName,
 
978
                (ndr_print_function_t) ndr_print_dssetup_DsRoleDnsNameToFlatName,
 
979
                false,
 
980
        },
 
981
        {
 
982
                "dssetup_DsRoleDcAsDc",
 
983
                sizeof(struct dssetup_DsRoleDcAsDc),
 
984
                (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleDcAsDc,
 
985
                (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleDcAsDc,
 
986
                (ndr_print_function_t) ndr_print_dssetup_DsRoleDcAsDc,
 
987
                false,
 
988
        },
 
989
        {
 
990
                "dssetup_DsRoleDcAsReplica",
 
991
                sizeof(struct dssetup_DsRoleDcAsReplica),
 
992
                (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleDcAsReplica,
 
993
                (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleDcAsReplica,
 
994
                (ndr_print_function_t) ndr_print_dssetup_DsRoleDcAsReplica,
 
995
                false,
 
996
        },
 
997
        {
 
998
                "dssetup_DsRoleDemoteDc",
 
999
                sizeof(struct dssetup_DsRoleDemoteDc),
 
1000
                (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleDemoteDc,
 
1001
                (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleDemoteDc,
 
1002
                (ndr_print_function_t) ndr_print_dssetup_DsRoleDemoteDc,
 
1003
                false,
 
1004
        },
 
1005
        {
 
1006
                "dssetup_DsRoleGetDcOperationProgress",
 
1007
                sizeof(struct dssetup_DsRoleGetDcOperationProgress),
 
1008
                (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleGetDcOperationProgress,
 
1009
                (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleGetDcOperationProgress,
 
1010
                (ndr_print_function_t) ndr_print_dssetup_DsRoleGetDcOperationProgress,
 
1011
                false,
 
1012
        },
 
1013
        {
 
1014
                "dssetup_DsRoleGetDcOperationResults",
 
1015
                sizeof(struct dssetup_DsRoleGetDcOperationResults),
 
1016
                (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleGetDcOperationResults,
 
1017
                (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleGetDcOperationResults,
 
1018
                (ndr_print_function_t) ndr_print_dssetup_DsRoleGetDcOperationResults,
 
1019
                false,
 
1020
        },
 
1021
        {
 
1022
                "dssetup_DsRoleCancel",
 
1023
                sizeof(struct dssetup_DsRoleCancel),
 
1024
                (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleCancel,
 
1025
                (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleCancel,
 
1026
                (ndr_print_function_t) ndr_print_dssetup_DsRoleCancel,
 
1027
                false,
 
1028
        },
 
1029
        {
 
1030
                "dssetup_DsRoleServerSaveStateForUpgrade",
 
1031
                sizeof(struct dssetup_DsRoleServerSaveStateForUpgrade),
 
1032
                (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleServerSaveStateForUpgrade,
 
1033
                (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleServerSaveStateForUpgrade,
 
1034
                (ndr_print_function_t) ndr_print_dssetup_DsRoleServerSaveStateForUpgrade,
 
1035
                false,
 
1036
        },
 
1037
        {
 
1038
                "dssetup_DsRoleUpgradeDownlevelServer",
 
1039
                sizeof(struct dssetup_DsRoleUpgradeDownlevelServer),
 
1040
                (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleUpgradeDownlevelServer,
 
1041
                (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleUpgradeDownlevelServer,
 
1042
                (ndr_print_function_t) ndr_print_dssetup_DsRoleUpgradeDownlevelServer,
 
1043
                false,
 
1044
        },
 
1045
        {
 
1046
                "dssetup_DsRoleAbortDownlevelServerUpgrade",
 
1047
                sizeof(struct dssetup_DsRoleAbortDownlevelServerUpgrade),
 
1048
                (ndr_push_flags_fn_t) ndr_push_dssetup_DsRoleAbortDownlevelServerUpgrade,
 
1049
                (ndr_pull_flags_fn_t) ndr_pull_dssetup_DsRoleAbortDownlevelServerUpgrade,
 
1050
                (ndr_print_function_t) ndr_print_dssetup_DsRoleAbortDownlevelServerUpgrade,
 
1051
                false,
 
1052
        },
 
1053
        { NULL, 0, NULL, NULL, NULL, false }
 
1054
};
 
1055
 
 
1056
static const char * const dssetup_endpoint_strings[] = {
 
1057
        "ncacn_np:[\\pipe\\lsarpc]", 
 
1058
        "ncacn_np:[\\pipe\\lsass]", 
 
1059
        "ncacn_ip_tcp:", 
 
1060
        "ncalrpc:", 
 
1061
};
 
1062
 
 
1063
static const struct ndr_interface_string_array dssetup_endpoints = {
 
1064
        .count  = 4,
 
1065
        .names  = dssetup_endpoint_strings
 
1066
};
 
1067
 
 
1068
static const char * const dssetup_authservice_strings[] = {
 
1069
        "host", 
 
1070
};
 
1071
 
 
1072
static const struct ndr_interface_string_array dssetup_authservices = {
 
1073
        .count  = 1,
 
1074
        .names  = dssetup_authservice_strings
 
1075
};
 
1076
 
 
1077
 
 
1078
const struct ndr_interface_table ndr_table_dssetup = {
 
1079
        .name           = "dssetup",
 
1080
        .syntax_id      = {
 
1081
                {0x3919286a,0xb10c,0x11d0,{0x9b,0xa8},{0x00,0xc0,0x4f,0xd9,0x2e,0xf5}},
 
1082
                NDR_DSSETUP_VERSION
 
1083
        },
 
1084
        .helpstring     = NDR_DSSETUP_HELPSTRING,
 
1085
        .num_calls      = 11,
 
1086
        .calls          = dssetup_calls,
 
1087
        .endpoints      = &dssetup_endpoints,
 
1088
        .authservices   = &dssetup_authservices
 
1089
};
 
1090