tdb: always open internal databases with incompatible hash.
[Samba.git] / librpc / ndr / ndr_drsuapi.c
blobcef617ba163f6fb59fe7843dabc56d097e37933f
1 /*
2 Unix SMB/CIFS implementation.
4 routines for printing some linked list structs in DRSUAPI
6 Copyright (C) Stefan (metze) Metzmacher 2005
7 Copyright (C) Matthieu Patou 2013
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>.
24 #include "includes.h"
25 #include "librpc/gen_ndr/ndr_drsuapi.h"
26 #include "librpc/gen_ndr/ndr_misc.h"
27 #include "../lib/util/asn1.h"
28 #include "librpc/ndr/ndr_compression.h"
29 /* We don't need multibyte if we're just comparing to 'ff' */
30 #undef strncasecmp
32 void ndr_print_drsuapi_DsReplicaObjectListItem(struct ndr_print *ndr, const char *name,
33 const struct drsuapi_DsReplicaObjectListItem *r)
35 ndr_print_struct(ndr, name, "drsuapi_DsReplicaObjectListItem");
36 ndr->depth++;
37 ndr_print_ptr(ndr, "next_object", r->next_object);
38 ndr_print_drsuapi_DsReplicaObject(ndr, "object", &r->object);
39 ndr->depth--;
40 if (r->next_object) {
41 ndr_print_drsuapi_DsReplicaObjectListItem(ndr, "next_object", r->next_object);
45 void ndr_print_drsuapi_DsReplicaObjectListItemEx(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjectListItemEx *r)
47 ndr_print_struct(ndr, name, "drsuapi_DsReplicaObjectListItemEx");
48 ndr->depth++;
49 ndr_print_ptr(ndr, "next_object", r->next_object);
50 ndr_print_drsuapi_DsReplicaObject(ndr, "object", &r->object);
51 ndr_print_uint32(ndr, "is_nc_prefix", r->is_nc_prefix);
52 ndr_print_ptr(ndr, "parent_object_guid", r->parent_object_guid);
53 ndr->depth++;
54 if (r->parent_object_guid) {
55 ndr_print_GUID(ndr, "parent_object_guid", r->parent_object_guid);
57 ndr->depth--;
58 ndr_print_ptr(ndr, "meta_data_ctr", r->meta_data_ctr);
59 ndr->depth++;
60 if (r->meta_data_ctr) {
61 ndr_print_drsuapi_DsReplicaMetaDataCtr(ndr, "meta_data_ctr", r->meta_data_ctr);
63 ndr->depth--;
64 ndr->depth--;
65 if (r->next_object) {
66 ndr_print_drsuapi_DsReplicaObjectListItemEx(ndr, "next_object", r->next_object);
70 _PUBLIC_ void ndr_print_drsuapi_DsReplicaOID(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaOID *r)
72 ndr_print_struct(ndr, name, "drsuapi_DsReplicaOID");
73 ndr->depth++;
74 ndr_print_uint32(ndr, "length", r->length);
75 ndr->print(ndr, "%-25s: length=%u", "oid", r->length);
76 if (r->binary_oid) {
77 char *partial_oid = NULL;
78 DATA_BLOB oid_blob = data_blob_const(r->binary_oid, r->length);
79 char *hex_str = data_blob_hex_string_upper(ndr, &oid_blob);
80 ber_read_partial_OID_String(ndr, oid_blob, &partial_oid);
81 ndr->depth++;
82 ndr->print(ndr, "%-25s: 0x%s (%s)", "binary_oid", hex_str, partial_oid);
83 ndr->depth--;
84 talloc_free(hex_str);
85 talloc_free(partial_oid);
87 ndr->depth--;
90 static void _print_drsuapi_DsAttributeValue_attid(struct ndr_print *ndr, const char *name,
91 const struct drsuapi_DsAttributeValue *r)
93 uint32_t v;
95 ndr_print_struct(ndr, name, "drsuapi_DsAttributeValue");
96 ndr->depth++;
97 v = IVAL(r->blob->data, 0);
98 ndr_print_uint32(ndr, "attid", v);
99 ndr->depth--;
102 static void _print_drsuapi_DsAttributeValue_str(struct ndr_print *ndr, const char *name,
103 const struct drsuapi_DsAttributeValue *r)
105 void *p;
106 size_t converted_size = 0;
108 ndr_print_struct(ndr, name, "drsuapi_DsAttributeValue");
109 ndr->depth++;
110 if (!convert_string_talloc(ndr,
111 CH_UTF16, CH_UNIX,
112 r->blob->data,
113 r->blob->length,
114 &p, &converted_size)) {
115 ndr_print_string(ndr, "string", "INVALID CONVERSION");
116 } else {
117 char *str = (char *)p;
118 ndr_print_string(ndr, "string", str);
119 talloc_free(str);
121 ndr->depth--;
124 static void _print_drsuapi_DsAttributeValueCtr(struct ndr_print *ndr,
125 const char *name,
126 const struct drsuapi_DsAttributeValueCtr *r,
127 void (*print_val_fn)(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAttributeValue *r))
129 uint32_t cntr_values_1;
130 ndr_print_struct(ndr, name, "drsuapi_DsAttributeValueCtr");
131 ndr->depth++;
132 ndr_print_uint32(ndr, "num_values", r->num_values);
133 ndr_print_ptr(ndr, "values", r->values);
134 ndr->depth++;
135 if (r->values) {
136 ndr->print(ndr, "%s: ARRAY(%d)", "values", (int)r->num_values);
137 ndr->depth++;
138 for (cntr_values_1=0;cntr_values_1<r->num_values;cntr_values_1++) {
139 char *idx_1=NULL;
140 if (asprintf(&idx_1, "[%d]", cntr_values_1) != -1) {
141 //ndr_print_drsuapi_DsAttributeValue(ndr, "values", &r->values[cntr_values_1]);
142 print_val_fn(ndr, "values", &r->values[cntr_values_1]);
143 free(idx_1);
146 ndr->depth--;
148 ndr->depth--;
149 ndr->depth--;
152 _PUBLIC_ void ndr_print_drsuapi_DsReplicaAttribute(struct ndr_print *ndr,
153 const char *name,
154 const struct drsuapi_DsReplicaAttribute *r)
156 ndr_print_struct(ndr, name, "drsuapi_DsReplicaAttribute");
157 ndr->depth++;
158 ndr_print_drsuapi_DsAttributeId(ndr, "attid", r->attid);
159 switch (r->attid) {
160 case DRSUAPI_ATTID_objectClass:
161 case DRSUAPI_ATTID_possSuperiors:
162 case DRSUAPI_ATTID_subClassOf:
163 case DRSUAPI_ATTID_governsID:
164 case DRSUAPI_ATTID_mustContain:
165 case DRSUAPI_ATTID_mayContain:
166 case DRSUAPI_ATTID_rDNAttId:
167 case DRSUAPI_ATTID_attributeID:
168 case DRSUAPI_ATTID_attributeSyntax:
169 case DRSUAPI_ATTID_auxiliaryClass:
170 case DRSUAPI_ATTID_systemPossSuperiors:
171 case DRSUAPI_ATTID_systemMayContain:
172 case DRSUAPI_ATTID_systemMustContain:
173 case DRSUAPI_ATTID_systemAuxiliaryClass:
174 case DRSUAPI_ATTID_transportAddressAttribute:
175 /* ATTIDs for classSchema and attributeSchema */
176 _print_drsuapi_DsAttributeValueCtr(ndr, "value_ctr", &r->value_ctr,
177 _print_drsuapi_DsAttributeValue_attid);
178 break;
179 case DRSUAPI_ATTID_cn:
180 case DRSUAPI_ATTID_ou:
181 case DRSUAPI_ATTID_description:
182 case DRSUAPI_ATTID_displayName:
183 case DRSUAPI_ATTID_dMDLocation:
184 case DRSUAPI_ATTID_adminDisplayName:
185 case DRSUAPI_ATTID_adminDescription:
186 case DRSUAPI_ATTID_lDAPDisplayName:
187 case DRSUAPI_ATTID_name:
188 _print_drsuapi_DsAttributeValueCtr(ndr, "value_ctr", &r->value_ctr,
189 _print_drsuapi_DsAttributeValue_str);
190 break;
191 default:
192 _print_drsuapi_DsAttributeValueCtr(ndr, "value_ctr", &r->value_ctr,
193 ndr_print_drsuapi_DsAttributeValue);
194 break;
196 ndr->depth--;
199 enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesMSZIPCtr1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesMSZIPCtr1 *r)
201 if (ndr_flags & NDR_SCALARS) {
202 uint32_t decompressed_length = 0;
203 uint32_t compressed_length = 0;
204 if (r->ts) {
206 struct ndr_push *_ndr_ts;
207 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_ts, 4, -1));
209 struct ndr_push *_ndr_ts_compressed;
210 NDR_CHECK(ndr_push_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_MSZIP, -1));
211 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr1TS(_ndr_ts_compressed, NDR_SCALARS|NDR_BUFFERS, r->ts));
212 decompressed_length = _ndr_ts_compressed->offset;
213 NDR_CHECK(ndr_push_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_MSZIP, -1));
215 compressed_length = _ndr_ts->offset;
216 talloc_free(_ndr_ts);
219 NDR_CHECK(ndr_push_align(ndr, 4));
220 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, decompressed_length));
221 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, compressed_length));
222 NDR_CHECK(ndr_push_unique_ptr(ndr, r->ts));
224 if (ndr_flags & NDR_BUFFERS) {
225 if (r->ts) {
227 struct ndr_push *_ndr_ts;
228 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_ts, 4, -1));
230 struct ndr_push *_ndr_ts_compressed;
231 NDR_CHECK(ndr_push_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_MSZIP, -1));
232 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr1TS(_ndr_ts_compressed, NDR_SCALARS|NDR_BUFFERS, r->ts));
233 NDR_CHECK(ndr_push_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_MSZIP, -1));
235 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_ts, 4, -1));
239 return NDR_ERR_SUCCESS;
242 enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesMSZIPCtr6(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesMSZIPCtr6 *r)
244 if (ndr_flags & NDR_SCALARS) {
245 uint32_t decompressed_length = 0;
246 uint32_t compressed_length = 0;
247 if (r->ts) {
249 struct ndr_push *_ndr_ts;
250 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_ts, 4, -1));
252 struct ndr_push *_ndr_ts_compressed;
253 NDR_CHECK(ndr_push_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_MSZIP, -1));
254 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr6TS(_ndr_ts_compressed, NDR_SCALARS|NDR_BUFFERS, r->ts));
255 decompressed_length = _ndr_ts_compressed->offset;
256 NDR_CHECK(ndr_push_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_MSZIP, -1));
258 compressed_length = _ndr_ts->offset;
259 talloc_free(_ndr_ts);
262 NDR_CHECK(ndr_push_align(ndr, 4));
263 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, decompressed_length));
264 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, compressed_length));
265 NDR_CHECK(ndr_push_unique_ptr(ndr, r->ts));
267 if (ndr_flags & NDR_BUFFERS) {
268 if (r->ts) {
270 struct ndr_push *_ndr_ts;
271 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_ts, 4, -1));
273 struct ndr_push *_ndr_ts_compressed;
274 NDR_CHECK(ndr_push_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_MSZIP, -1));
275 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr6TS(_ndr_ts_compressed, NDR_SCALARS|NDR_BUFFERS, r->ts));
276 NDR_CHECK(ndr_push_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_MSZIP, -1));
278 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_ts, 4, -1));
282 return NDR_ERR_SUCCESS;
285 enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesXPRESSCtr1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesXPRESSCtr1 *r)
287 if (ndr_flags & NDR_SCALARS) {
288 uint32_t decompressed_length = 0;
289 uint32_t compressed_length = 0;
290 if (r->ts) {
292 struct ndr_push *_ndr_ts;
293 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_ts, 4, -1));
295 struct ndr_push *_ndr_ts_compressed;
296 NDR_CHECK(ndr_push_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_XPRESS, -1));
297 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr1TS(_ndr_ts_compressed, NDR_SCALARS|NDR_BUFFERS, r->ts));
298 decompressed_length = _ndr_ts_compressed->offset;
299 NDR_CHECK(ndr_push_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_XPRESS, -1));
301 compressed_length = _ndr_ts->offset;
302 talloc_free(_ndr_ts);
305 NDR_CHECK(ndr_push_align(ndr, 4));
306 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, decompressed_length));
307 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, compressed_length));
308 NDR_CHECK(ndr_push_unique_ptr(ndr, r->ts));
310 if (ndr_flags & NDR_BUFFERS) {
311 if (r->ts) {
313 struct ndr_push *_ndr_ts;
314 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_ts, 4, -1));
316 struct ndr_push *_ndr_ts_compressed;
317 NDR_CHECK(ndr_push_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_XPRESS, -1));
318 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr1TS(_ndr_ts_compressed, NDR_SCALARS|NDR_BUFFERS, r->ts));
319 NDR_CHECK(ndr_push_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_XPRESS, -1));
321 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_ts, 4, -1));
325 return NDR_ERR_SUCCESS;
328 enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesXPRESSCtr6(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesXPRESSCtr6 *r)
330 if (ndr_flags & NDR_SCALARS) {
331 uint32_t decompressed_length = 0;
332 uint32_t compressed_length = 0;
333 if (r->ts) {
335 struct ndr_push *_ndr_ts;
336 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_ts, 4, -1));
338 struct ndr_push *_ndr_ts_compressed;
339 NDR_CHECK(ndr_push_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_XPRESS, -1));
340 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr6TS(_ndr_ts_compressed, NDR_SCALARS|NDR_BUFFERS, r->ts));
341 decompressed_length = _ndr_ts_compressed->offset;
342 NDR_CHECK(ndr_push_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_XPRESS, -1));
344 compressed_length = _ndr_ts->offset;
345 talloc_free(_ndr_ts);
348 NDR_CHECK(ndr_push_align(ndr, 4));
349 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, decompressed_length));
350 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, compressed_length));
351 NDR_CHECK(ndr_push_unique_ptr(ndr, r->ts));
353 if (ndr_flags & NDR_BUFFERS) {
354 if (r->ts) {
356 struct ndr_push *_ndr_ts;
357 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_ts, 4, -1));
359 struct ndr_push *_ndr_ts_compressed;
360 NDR_CHECK(ndr_push_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_XPRESS, -1));
361 NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr6TS(_ndr_ts_compressed, NDR_SCALARS|NDR_BUFFERS, r->ts));
362 NDR_CHECK(ndr_push_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_XPRESS, -1));
364 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_ts, 4, -1));
368 return NDR_ERR_SUCCESS;
371 _PUBLIC_ size_t ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary_without_Binary(const struct drsuapi_DsReplicaObjectIdentifier3Binary *r, int flags)
373 return ndr_size_struct((const struct drsuapi_DsReplicaObjectIdentifier3 *)r, flags, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3);
376 _PUBLIC_ void ndr_print_drsuapi_SecBufferType(struct ndr_print *ndr, const char *name, enum drsuapi_SecBufferType r)
378 const char *val = NULL;
380 switch (r & 0x00000007) {
381 case DRSUAPI_SECBUFFER_EMPTY: val = "DRSUAPI_SECBUFFER_EMPTY"; break;
382 case DRSUAPI_SECBUFFER_DATA: val = "DRSUAPI_SECBUFFER_DATA"; break;
383 case DRSUAPI_SECBUFFER_TOKEN: val = "DRSUAPI_SECBUFFER_TOKEN"; break;
384 case DRSUAPI_SECBUFFER_PKG_PARAMS: val = "DRSUAPI_SECBUFFER_PKG_PARAMS"; break;
385 case DRSUAPI_SECBUFFER_MISSING: val = "DRSUAPI_SECBUFFER_MISSING"; break;
386 case DRSUAPI_SECBUFFER_EXTRA: val = "DRSUAPI_SECBUFFER_EXTRA"; break;
387 case DRSUAPI_SECBUFFER_STREAM_TRAILER: val = "DRSUAPI_SECBUFFER_STREAM_TRAILER"; break;
388 case DRSUAPI_SECBUFFER_STREAM_HEADER: val = "DRSUAPI_SECBUFFER_STREAM_HEADER"; break;
391 if (r & DRSUAPI_SECBUFFER_READONLY) {
392 char *v = talloc_asprintf(ndr, "DRSUAPI_SECBUFFER_READONLY | %s", val);
393 ndr_print_enum(ndr, name, "ENUM", v, r);
394 } else {
395 ndr_print_enum(ndr, name, "ENUM", val, r);
399 _PUBLIC_ void ndr_print_drsuapi_DsAddEntry_AttrErrListItem_V1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntry_AttrErrListItem_V1 *r)
401 ndr_print_struct(ndr, name, "drsuapi_DsAddEntry_AttrErrListItem_V1");
402 ndr->depth++;
403 ndr_print_ptr(ndr, "next", r->next);
404 ndr_print_drsuapi_DsAddEntry_AttrErr_V1(ndr, "err_data", &r->err_data);
405 ndr->depth--;
406 if (r->next) {
407 ndr_print_drsuapi_DsAddEntry_AttrErrListItem_V1(ndr, "next", r->next);
411 enum ndr_err_code ndr_push_drsuapi_DsBindInfo(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsBindInfo *r)
413 NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
414 if (ndr_flags & NDR_SCALARS) {
415 uint32_t level = ndr_push_get_switch_value(ndr, r);
416 NDR_CHECK(ndr_push_union_align(ndr, 4));
417 switch (level) {
418 case 24: {
420 struct ndr_push *_ndr_info24;
421 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_info24, 0, 24));
422 NDR_CHECK(ndr_push_drsuapi_DsBindInfo24(_ndr_info24, NDR_SCALARS, &r->info24));
423 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info24, 0, 24));
425 break; }
427 case 28: {
429 struct ndr_push *_ndr_info28;
430 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_info28, 0, 28));
431 NDR_CHECK(ndr_push_drsuapi_DsBindInfo28(_ndr_info28, NDR_SCALARS, &r->info28));
432 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info28, 0, 28));
434 break; }
436 case 48: {
438 struct ndr_push *_ndr_info48;
439 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_info48, 0, 48));
440 NDR_CHECK(ndr_push_drsuapi_DsBindInfo48(_ndr_info48, NDR_SCALARS, &r->info48));
441 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info48, 0, 48));
443 break; }
445 default: {
447 struct ndr_push *_ndr_Fallback;
448 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_Fallback, 0, level));
449 NDR_CHECK(ndr_push_drsuapi_DsBindInfoFallBack(_ndr_Fallback, NDR_SCALARS, &r->Fallback));
450 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_Fallback, 0, level));
452 break; }
456 if (ndr_flags & NDR_BUFFERS) {
457 uint32_t level = ndr_push_get_switch_value(ndr, r);
458 switch (level) {
459 case 24:
460 break;
462 case 28:
463 break;
465 case 48:
466 break;
468 default:
469 break;
473 return NDR_ERR_SUCCESS;
476 enum ndr_err_code ndr_pull_drsuapi_DsBindInfo(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsBindInfo *r)
478 uint32_t level;
479 level = ndr_pull_get_switch_value(ndr, r);
480 NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
481 if (ndr_flags & NDR_SCALARS) {
482 NDR_CHECK(ndr_pull_union_align(ndr, 4));
483 switch (level) {
484 case 24: {
486 struct ndr_pull *_ndr_info24;
487 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_info24, 0, 24));
488 NDR_CHECK(ndr_pull_drsuapi_DsBindInfo24(_ndr_info24, NDR_SCALARS, &r->info24));
489 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_info24, 0, 24));
491 break; }
493 case 28: {
495 struct ndr_pull *_ndr_info28;
496 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_info28, 0, 28));
497 NDR_CHECK(ndr_pull_drsuapi_DsBindInfo28(_ndr_info28, NDR_SCALARS, &r->info28));
498 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_info28, 0, 28));
500 break; }
502 case 48: {
504 struct ndr_pull *_ndr_info48;
505 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_info48, 0, 48));
506 NDR_CHECK(ndr_pull_drsuapi_DsBindInfo48(_ndr_info48, NDR_SCALARS, &r->info48));
507 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_info48, 0, 48));
509 break; }
511 default: {
513 struct ndr_pull *_ndr_Fallback;
514 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_Fallback, 0, level));
515 NDR_CHECK(ndr_pull_drsuapi_DsBindInfoFallBack(_ndr_Fallback, NDR_SCALARS, &r->Fallback));
516 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_Fallback, 0, level));
518 break; }
522 if (ndr_flags & NDR_BUFFERS) {
523 switch (level) {
524 case 24:
525 break;
527 case 28:
528 break;
530 case 48:
531 break;
533 default:
534 break;
538 return NDR_ERR_SUCCESS;
541 _PUBLIC_ void ndr_print_drsuapi_DsBindInfo(struct ndr_print *ndr, const char *name, const union drsuapi_DsBindInfo *r)
543 uint32_t level;
544 level = ndr_print_get_switch_value(ndr, r);
545 ndr_print_union(ndr, name, level, "drsuapi_DsBindInfo");
546 switch (level) {
547 case 24:
548 ndr_print_drsuapi_DsBindInfo24(ndr, "info24", &r->info24);
549 break;
551 case 28:
552 ndr_print_drsuapi_DsBindInfo28(ndr, "info28", &r->info28);
553 break;
555 case 48:
556 ndr_print_drsuapi_DsBindInfo48(ndr, "info48", &r->info48);
557 break;
559 default:
560 ndr_print_drsuapi_DsBindInfoFallBack(ndr, "Fallback", &r->Fallback);
561 break;