xattr.id: Fix a typo
[Samba.git] / librpc / ndr / ndr_drsuapi.c
blob45d3ac095c3eb3734dacb89a97ac37c60014b219
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 uint32_t _flags_save = ndr->flags;
414 ndr->flags = ndr->flags & ~LIBNDR_FLAG_NDR64;
415 NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
416 if (ndr_flags & NDR_SCALARS) {
417 uint32_t level = ndr_push_get_switch_value(ndr, r);
418 NDR_CHECK(ndr_push_union_align(ndr, 4));
419 switch (level) {
420 case 24: {
422 struct ndr_push *_ndr_info24;
423 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_info24, 0, 24));
424 NDR_CHECK(ndr_push_drsuapi_DsBindInfo24(_ndr_info24, NDR_SCALARS, &r->info24));
425 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info24, 0, 24));
427 break; }
429 case 28: {
431 struct ndr_push *_ndr_info28;
432 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_info28, 0, 28));
433 NDR_CHECK(ndr_push_drsuapi_DsBindInfo28(_ndr_info28, NDR_SCALARS, &r->info28));
434 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info28, 0, 28));
436 break; }
438 case 48: {
440 struct ndr_push *_ndr_info48;
441 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_info48, 0, 48));
442 NDR_CHECK(ndr_push_drsuapi_DsBindInfo48(_ndr_info48, NDR_SCALARS, &r->info48));
443 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info48, 0, 48));
445 break; }
447 case 52: {
449 struct ndr_push *_ndr_info52;
450 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_info52, 0, 52));
451 NDR_CHECK(ndr_push_drsuapi_DsBindInfo52(_ndr_info52, NDR_SCALARS, &r->info52));
452 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info52, 0, 52));
454 break; }
456 default: {
458 struct ndr_push *_ndr_Fallback;
459 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_Fallback, 0, level));
460 NDR_CHECK(ndr_push_drsuapi_DsBindInfoFallBack(_ndr_Fallback, NDR_SCALARS, &r->Fallback));
461 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_Fallback, 0, level));
463 break; }
467 if (ndr_flags & NDR_BUFFERS) {
468 uint32_t level = ndr_push_get_switch_value(ndr, r);
469 switch (level) {
470 case 24:
471 break;
473 case 28:
474 break;
476 case 48:
477 break;
479 case 52:
480 break;
482 default:
483 break;
487 ndr->flags = _flags_save;
488 return NDR_ERR_SUCCESS;
491 enum ndr_err_code ndr_pull_drsuapi_DsBindInfo(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsBindInfo *r)
493 uint32_t level;
494 uint32_t _flags_save = ndr->flags;
495 ndr->flags = ndr->flags & ~LIBNDR_FLAG_NDR64;
496 level = ndr_pull_get_switch_value(ndr, r);
497 NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
498 if (ndr_flags & NDR_SCALARS) {
499 NDR_CHECK(ndr_pull_union_align(ndr, 4));
500 switch (level) {
501 case 24: {
503 struct ndr_pull *_ndr_info24;
504 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_info24, 0, 24));
505 NDR_CHECK(ndr_pull_drsuapi_DsBindInfo24(_ndr_info24, NDR_SCALARS, &r->info24));
506 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_info24, 0, 24));
508 break; }
510 case 28: {
512 struct ndr_pull *_ndr_info28;
513 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_info28, 0, 28));
514 NDR_CHECK(ndr_pull_drsuapi_DsBindInfo28(_ndr_info28, NDR_SCALARS, &r->info28));
515 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_info28, 0, 28));
517 break; }
519 case 48: {
521 struct ndr_pull *_ndr_info48;
522 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_info48, 0, 48));
523 NDR_CHECK(ndr_pull_drsuapi_DsBindInfo48(_ndr_info48, NDR_SCALARS, &r->info48));
524 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_info48, 0, 48));
526 break; }
528 case 52: {
530 struct ndr_pull *_ndr_info52;
531 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_info52, 0, 52));
532 NDR_CHECK(ndr_pull_drsuapi_DsBindInfo52(_ndr_info52, NDR_SCALARS, &r->info52));
533 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_info52, 0, 52));
535 break; }
537 default: {
539 struct ndr_pull *_ndr_Fallback;
540 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_Fallback, 0, level));
541 NDR_CHECK(ndr_pull_drsuapi_DsBindInfoFallBack(_ndr_Fallback, NDR_SCALARS, &r->Fallback));
542 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_Fallback, 0, level));
544 break; }
548 if (ndr_flags & NDR_BUFFERS) {
549 switch (level) {
550 case 24:
551 break;
553 case 28:
554 break;
556 case 48:
557 break;
559 case 52:
560 break;
562 default:
563 break;
567 ndr->flags = _flags_save;
568 return NDR_ERR_SUCCESS;
571 _PUBLIC_ void ndr_print_drsuapi_DsBindInfo(struct ndr_print *ndr, const char *name, const union drsuapi_DsBindInfo *r)
573 uint32_t level;
574 level = ndr_print_get_switch_value(ndr, r);
575 ndr_print_union(ndr, name, level, "drsuapi_DsBindInfo");
576 switch (level) {
577 case 24:
578 ndr_print_drsuapi_DsBindInfo24(ndr, "info24", &r->info24);
579 break;
581 case 28:
582 ndr_print_drsuapi_DsBindInfo28(ndr, "info28", &r->info28);
583 break;
585 case 48:
586 ndr_print_drsuapi_DsBindInfo48(ndr, "info48", &r->info48);
587 break;
589 case 52:
590 ndr_print_drsuapi_DsBindInfo52(ndr, "info52", &r->info52);
591 break;
593 default:
594 ndr_print_drsuapi_DsBindInfoFallBack(ndr, "Fallback", &r->Fallback);
595 break;