Line data Source code
1 : /*
2 : Unix SMB/CIFS implementation.
3 :
4 : routines for printing some linked list structs in DRSUAPI
5 :
6 : Copyright (C) Stefan (metze) Metzmacher 2005
7 : Copyright (C) Matthieu Patou 2013
8 :
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.
13 :
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.
18 :
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/>.
21 : */
22 :
23 :
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
31 :
32 0 : void ndr_print_drsuapi_DsReplicaObjectListItem(struct ndr_print *ndr, const char *name,
33 : const struct drsuapi_DsReplicaObjectListItem *r)
34 : {
35 0 : ndr_print_struct(ndr, name, "drsuapi_DsReplicaObjectListItem");
36 0 : ndr->depth++;
37 0 : ndr_print_ptr(ndr, "next_object", r->next_object);
38 0 : ndr_print_drsuapi_DsReplicaObject(ndr, "object", &r->object);
39 0 : ndr->depth--;
40 0 : if (r->next_object) {
41 0 : ndr_print_drsuapi_DsReplicaObjectListItem(ndr, "next_object", r->next_object);
42 : }
43 0 : }
44 :
45 14530 : void ndr_print_drsuapi_DsReplicaObjectListItemEx(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjectListItemEx *r)
46 : {
47 14530 : ndr_print_struct(ndr, name, "drsuapi_DsReplicaObjectListItemEx");
48 14530 : ndr->depth++;
49 14530 : ndr_print_ptr(ndr, "next_object", r->next_object);
50 14530 : ndr_print_drsuapi_DsReplicaObject(ndr, "object", &r->object);
51 14530 : ndr_print_uint32(ndr, "is_nc_prefix", r->is_nc_prefix);
52 14530 : ndr_print_ptr(ndr, "parent_object_guid", r->parent_object_guid);
53 14530 : ndr->depth++;
54 14530 : if (r->parent_object_guid) {
55 14518 : ndr_print_GUID(ndr, "parent_object_guid", r->parent_object_guid);
56 : }
57 14530 : ndr->depth--;
58 14530 : ndr_print_ptr(ndr, "meta_data_ctr", r->meta_data_ctr);
59 14530 : ndr->depth++;
60 14530 : if (r->meta_data_ctr) {
61 14530 : ndr_print_drsuapi_DsReplicaMetaDataCtr(ndr, "meta_data_ctr", r->meta_data_ctr);
62 : }
63 14530 : ndr->depth--;
64 14530 : ndr->depth--;
65 14530 : if (r->next_object) {
66 14486 : ndr_print_drsuapi_DsReplicaObjectListItemEx(ndr, "next_object", r->next_object);
67 : }
68 14530 : }
69 :
70 1914 : _PUBLIC_ void ndr_print_drsuapi_DsReplicaOID(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaOID *r)
71 : {
72 1914 : ndr_print_struct(ndr, name, "drsuapi_DsReplicaOID");
73 1914 : ndr->depth++;
74 1914 : ndr_print_uint32(ndr, "length", r->length);
75 1914 : ndr->print(ndr, "%-25s: length=%u", "oid", r->length);
76 1914 : if (r->binary_oid) {
77 1914 : char *partial_oid = NULL;
78 1914 : DATA_BLOB oid_blob = data_blob_const(r->binary_oid, r->length);
79 1914 : char *hex_str = data_blob_hex_string_upper(ndr, &oid_blob);
80 1914 : ber_read_partial_OID_String(ndr, oid_blob, &partial_oid);
81 1914 : ndr->depth++;
82 1914 : ndr->print(ndr, "%-25s: 0x%s (%s)", "binary_oid", hex_str, partial_oid);
83 1914 : ndr->depth--;
84 1914 : talloc_free(hex_str);
85 1914 : talloc_free(partial_oid);
86 : }
87 1914 : ndr->depth--;
88 1914 : }
89 :
90 55240 : static void _print_drsuapi_DsAttributeValue_attid(struct ndr_print *ndr, const char *name,
91 : const struct drsuapi_DsAttributeValue *r)
92 : {
93 : uint32_t v;
94 :
95 55240 : ndr_print_struct(ndr, name, "drsuapi_DsAttributeValue");
96 55240 : ndr->depth++;
97 55240 : if (r->blob == NULL || r->blob->data == NULL) {
98 0 : ndr_print_string(ndr, "attid", "NULL");
99 55240 : } else if (r->blob->length < 4) {
100 0 : ndr_print_DATA_BLOB(ndr, "attid", *r->blob);
101 : } else {
102 55240 : v = IVAL(r->blob->data, 0);
103 55240 : ndr_print_uint32(ndr, "attid", v);
104 : }
105 55240 : ndr->depth--;
106 55240 : }
107 :
108 36024 : static void _print_drsuapi_DsAttributeValue_str(struct ndr_print *ndr, const char *name,
109 : const struct drsuapi_DsAttributeValue *r)
110 : {
111 : void *p;
112 36024 : size_t converted_size = 0;
113 :
114 36024 : ndr_print_struct(ndr, name, "drsuapi_DsAttributeValue");
115 36024 : ndr->depth++;
116 36024 : if (r->blob == NULL || r->blob->data == NULL) {
117 0 : ndr_print_string(ndr, "string", "NULL");
118 72048 : } else if (!convert_string_talloc(ndr,
119 : CH_UTF16, CH_UNIX,
120 36024 : r->blob->data,
121 36024 : r->blob->length,
122 : &p, &converted_size)) {
123 4 : ndr_print_DATA_BLOB(ndr, "string (INVALID CONVERSION)",
124 4 : *r->blob);
125 : } else {
126 36020 : char *str = (char *)p;
127 36020 : ndr_print_string(ndr, "string", str);
128 36020 : talloc_free(str);
129 : }
130 36024 : ndr->depth--;
131 36024 : }
132 :
133 221172 : static void _print_drsuapi_DsAttributeValueCtr(struct ndr_print *ndr,
134 : const char *name,
135 : const struct drsuapi_DsAttributeValueCtr *r,
136 : void (*print_val_fn)(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAttributeValue *r))
137 : {
138 : uint32_t cntr_values_1;
139 221172 : ndr_print_struct(ndr, name, "drsuapi_DsAttributeValueCtr");
140 221172 : ndr->depth++;
141 221172 : ndr_print_uint32(ndr, "num_values", r->num_values);
142 221172 : ndr_print_ptr(ndr, "values", r->values);
143 221172 : ndr->depth++;
144 221172 : if (r->values) {
145 218542 : ndr->print(ndr, "%s: ARRAY(%d)", "values", (int)r->num_values);
146 218542 : ndr->depth++;
147 507298 : for (cntr_values_1=0;cntr_values_1<r->num_values;cntr_values_1++) {
148 288756 : char *idx_1=NULL;
149 288756 : if (asprintf(&idx_1, "[%d]", cntr_values_1) != -1) {
150 : //ndr_print_drsuapi_DsAttributeValue(ndr, "values", &r->values[cntr_values_1]);
151 288756 : print_val_fn(ndr, "values", &r->values[cntr_values_1]);
152 288756 : free(idx_1);
153 : }
154 : }
155 218542 : ndr->depth--;
156 : }
157 221172 : ndr->depth--;
158 221172 : ndr->depth--;
159 221172 : }
160 :
161 221172 : _PUBLIC_ void ndr_print_drsuapi_DsReplicaAttribute(struct ndr_print *ndr,
162 : const char *name,
163 : const struct drsuapi_DsReplicaAttribute *r)
164 : {
165 221172 : ndr_print_struct(ndr, name, "drsuapi_DsReplicaAttribute");
166 221172 : ndr->depth++;
167 221172 : ndr_print_drsuapi_DsAttributeId(ndr, "attid", r->attid);
168 221172 : switch (r->attid) {
169 31866 : case DRSUAPI_ATTID_objectClass:
170 : case DRSUAPI_ATTID_possSuperiors:
171 : case DRSUAPI_ATTID_subClassOf:
172 : case DRSUAPI_ATTID_governsID:
173 : case DRSUAPI_ATTID_mustContain:
174 : case DRSUAPI_ATTID_mayContain:
175 : case DRSUAPI_ATTID_rDNAttId:
176 : case DRSUAPI_ATTID_attributeID:
177 : case DRSUAPI_ATTID_attributeSyntax:
178 : case DRSUAPI_ATTID_auxiliaryClass:
179 : case DRSUAPI_ATTID_systemPossSuperiors:
180 : case DRSUAPI_ATTID_systemMayContain:
181 : case DRSUAPI_ATTID_systemMustContain:
182 : case DRSUAPI_ATTID_systemAuxiliaryClass:
183 : case DRSUAPI_ATTID_transportAddressAttribute:
184 : /* ATTIDs for classSchema and attributeSchema */
185 31866 : _print_drsuapi_DsAttributeValueCtr(ndr, "value_ctr", &r->value_ctr,
186 : _print_drsuapi_DsAttributeValue_attid);
187 31866 : break;
188 36252 : case DRSUAPI_ATTID_cn:
189 : case DRSUAPI_ATTID_ou:
190 : case DRSUAPI_ATTID_description:
191 : case DRSUAPI_ATTID_displayName:
192 : case DRSUAPI_ATTID_dMDLocation:
193 : case DRSUAPI_ATTID_adminDisplayName:
194 : case DRSUAPI_ATTID_adminDescription:
195 : case DRSUAPI_ATTID_lDAPDisplayName:
196 : case DRSUAPI_ATTID_name:
197 36252 : _print_drsuapi_DsAttributeValueCtr(ndr, "value_ctr", &r->value_ctr,
198 : _print_drsuapi_DsAttributeValue_str);
199 36252 : break;
200 153054 : default:
201 153054 : _print_drsuapi_DsAttributeValueCtr(ndr, "value_ctr", &r->value_ctr,
202 : ndr_print_drsuapi_DsAttributeValue);
203 153054 : break;
204 : }
205 221172 : ndr->depth--;
206 221172 : }
207 :
208 0 : enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesMSZIPCtr1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesMSZIPCtr1 *r)
209 : {
210 0 : if (ndr_flags & NDR_SCALARS) {
211 0 : uint32_t decompressed_length = 0;
212 0 : uint32_t compressed_length = 0;
213 0 : if (r->ts) {
214 : {
215 : struct ndr_push *_ndr_ts;
216 0 : NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_ts, 4, -1));
217 : {
218 : struct ndr_push *_ndr_ts_compressed;
219 0 : NDR_CHECK(ndr_push_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_MSZIP, -1));
220 0 : NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr1TS(_ndr_ts_compressed, NDR_SCALARS|NDR_BUFFERS, r->ts));
221 0 : decompressed_length = _ndr_ts_compressed->offset;
222 0 : NDR_CHECK(ndr_push_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_MSZIP, -1));
223 : }
224 0 : compressed_length = _ndr_ts->offset;
225 0 : talloc_free(_ndr_ts);
226 : }
227 : }
228 0 : NDR_CHECK(ndr_push_align(ndr, 4));
229 0 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, decompressed_length));
230 0 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, compressed_length));
231 0 : NDR_CHECK(ndr_push_unique_ptr(ndr, r->ts));
232 : }
233 0 : if (ndr_flags & NDR_BUFFERS) {
234 0 : if (r->ts) {
235 : {
236 : struct ndr_push *_ndr_ts;
237 0 : NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_ts, 4, -1));
238 : {
239 : struct ndr_push *_ndr_ts_compressed;
240 0 : NDR_CHECK(ndr_push_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_MSZIP, -1));
241 0 : NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr1TS(_ndr_ts_compressed, NDR_SCALARS|NDR_BUFFERS, r->ts));
242 0 : NDR_CHECK(ndr_push_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_MSZIP, -1));
243 : }
244 0 : NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_ts, 4, -1));
245 : }
246 : }
247 : }
248 0 : return NDR_ERR_SUCCESS;
249 : }
250 :
251 0 : enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesMSZIPCtr6(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesMSZIPCtr6 *r)
252 : {
253 0 : if (ndr_flags & NDR_SCALARS) {
254 0 : uint32_t decompressed_length = 0;
255 0 : uint32_t compressed_length = 0;
256 0 : if (r->ts) {
257 : {
258 : struct ndr_push *_ndr_ts;
259 0 : NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_ts, 4, -1));
260 : {
261 : struct ndr_push *_ndr_ts_compressed;
262 0 : NDR_CHECK(ndr_push_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_MSZIP, -1));
263 0 : NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr6TS(_ndr_ts_compressed, NDR_SCALARS|NDR_BUFFERS, r->ts));
264 0 : decompressed_length = _ndr_ts_compressed->offset;
265 0 : NDR_CHECK(ndr_push_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_MSZIP, -1));
266 : }
267 0 : compressed_length = _ndr_ts->offset;
268 0 : talloc_free(_ndr_ts);
269 : }
270 : }
271 0 : NDR_CHECK(ndr_push_align(ndr, 4));
272 0 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, decompressed_length));
273 0 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, compressed_length));
274 0 : NDR_CHECK(ndr_push_unique_ptr(ndr, r->ts));
275 : }
276 0 : if (ndr_flags & NDR_BUFFERS) {
277 0 : if (r->ts) {
278 : {
279 : struct ndr_push *_ndr_ts;
280 0 : NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_ts, 4, -1));
281 : {
282 : struct ndr_push *_ndr_ts_compressed;
283 0 : NDR_CHECK(ndr_push_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_MSZIP, -1));
284 0 : NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr6TS(_ndr_ts_compressed, NDR_SCALARS|NDR_BUFFERS, r->ts));
285 0 : NDR_CHECK(ndr_push_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_MSZIP, -1));
286 : }
287 0 : NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_ts, 4, -1));
288 : }
289 : }
290 : }
291 0 : return NDR_ERR_SUCCESS;
292 : }
293 :
294 0 : enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesXPRESSCtr1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesXPRESSCtr1 *r)
295 : {
296 0 : if (ndr_flags & NDR_SCALARS) {
297 0 : uint32_t decompressed_length = 0;
298 0 : uint32_t compressed_length = 0;
299 0 : if (r->ts) {
300 : {
301 : struct ndr_push *_ndr_ts;
302 0 : NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_ts, 4, -1));
303 : {
304 : struct ndr_push *_ndr_ts_compressed;
305 0 : NDR_CHECK(ndr_push_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_XPRESS, -1));
306 0 : NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr1TS(_ndr_ts_compressed, NDR_SCALARS|NDR_BUFFERS, r->ts));
307 0 : decompressed_length = _ndr_ts_compressed->offset;
308 0 : NDR_CHECK(ndr_push_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_XPRESS, -1));
309 : }
310 0 : compressed_length = _ndr_ts->offset;
311 0 : talloc_free(_ndr_ts);
312 : }
313 : }
314 0 : NDR_CHECK(ndr_push_align(ndr, 4));
315 0 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, decompressed_length));
316 0 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, compressed_length));
317 0 : NDR_CHECK(ndr_push_unique_ptr(ndr, r->ts));
318 : }
319 0 : if (ndr_flags & NDR_BUFFERS) {
320 0 : if (r->ts) {
321 : {
322 : struct ndr_push *_ndr_ts;
323 0 : NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_ts, 4, -1));
324 : {
325 : struct ndr_push *_ndr_ts_compressed;
326 0 : NDR_CHECK(ndr_push_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_XPRESS, -1));
327 0 : NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr1TS(_ndr_ts_compressed, NDR_SCALARS|NDR_BUFFERS, r->ts));
328 0 : NDR_CHECK(ndr_push_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_XPRESS, -1));
329 : }
330 0 : NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_ts, 4, -1));
331 : }
332 : }
333 : }
334 0 : return NDR_ERR_SUCCESS;
335 : }
336 :
337 0 : enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesXPRESSCtr6(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesXPRESSCtr6 *r)
338 : {
339 0 : if (ndr_flags & NDR_SCALARS) {
340 0 : uint32_t decompressed_length = 0;
341 0 : uint32_t compressed_length = 0;
342 0 : if (r->ts) {
343 : {
344 : struct ndr_push *_ndr_ts;
345 0 : NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_ts, 4, -1));
346 : {
347 : struct ndr_push *_ndr_ts_compressed;
348 0 : NDR_CHECK(ndr_push_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_XPRESS, -1));
349 0 : NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr6TS(_ndr_ts_compressed, NDR_SCALARS|NDR_BUFFERS, r->ts));
350 0 : decompressed_length = _ndr_ts_compressed->offset;
351 0 : NDR_CHECK(ndr_push_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_XPRESS, -1));
352 : }
353 0 : compressed_length = _ndr_ts->offset;
354 0 : talloc_free(_ndr_ts);
355 : }
356 : }
357 0 : NDR_CHECK(ndr_push_align(ndr, 4));
358 0 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, decompressed_length));
359 0 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, compressed_length));
360 0 : NDR_CHECK(ndr_push_unique_ptr(ndr, r->ts));
361 : }
362 0 : if (ndr_flags & NDR_BUFFERS) {
363 0 : if (r->ts) {
364 : {
365 : struct ndr_push *_ndr_ts;
366 0 : NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_ts, 4, -1));
367 : {
368 : struct ndr_push *_ndr_ts_compressed;
369 0 : NDR_CHECK(ndr_push_compression_start(_ndr_ts, &_ndr_ts_compressed, NDR_COMPRESSION_XPRESS, -1));
370 0 : NDR_CHECK(ndr_push_drsuapi_DsGetNCChangesCtr6TS(_ndr_ts_compressed, NDR_SCALARS|NDR_BUFFERS, r->ts));
371 0 : NDR_CHECK(ndr_push_compression_end(_ndr_ts, _ndr_ts_compressed, NDR_COMPRESSION_XPRESS, -1));
372 : }
373 0 : NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_ts, 4, -1));
374 : }
375 : }
376 : }
377 0 : return NDR_ERR_SUCCESS;
378 : }
379 :
380 9337 : _PUBLIC_ size_t ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary_without_Binary(const struct drsuapi_DsReplicaObjectIdentifier3Binary *r, int flags)
381 : {
382 9337 : return ndr_size_struct((const struct drsuapi_DsReplicaObjectIdentifier3 *)r, flags, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3);
383 : }
384 :
385 0 : _PUBLIC_ void ndr_print_drsuapi_SecBufferType(struct ndr_print *ndr, const char *name, enum drsuapi_SecBufferType r)
386 : {
387 0 : const char *val = NULL;
388 :
389 0 : switch (r & 0x00000007) {
390 0 : case DRSUAPI_SECBUFFER_EMPTY: val = "DRSUAPI_SECBUFFER_EMPTY"; break;
391 0 : case DRSUAPI_SECBUFFER_DATA: val = "DRSUAPI_SECBUFFER_DATA"; break;
392 0 : case DRSUAPI_SECBUFFER_TOKEN: val = "DRSUAPI_SECBUFFER_TOKEN"; break;
393 0 : case DRSUAPI_SECBUFFER_PKG_PARAMS: val = "DRSUAPI_SECBUFFER_PKG_PARAMS"; break;
394 0 : case DRSUAPI_SECBUFFER_MISSING: val = "DRSUAPI_SECBUFFER_MISSING"; break;
395 0 : case DRSUAPI_SECBUFFER_EXTRA: val = "DRSUAPI_SECBUFFER_EXTRA"; break;
396 0 : case DRSUAPI_SECBUFFER_STREAM_TRAILER: val = "DRSUAPI_SECBUFFER_STREAM_TRAILER"; break;
397 0 : case DRSUAPI_SECBUFFER_STREAM_HEADER: val = "DRSUAPI_SECBUFFER_STREAM_HEADER"; break;
398 : }
399 :
400 0 : if (r & DRSUAPI_SECBUFFER_READONLY) {
401 0 : char *v = talloc_asprintf(ndr, "DRSUAPI_SECBUFFER_READONLY | %s", val);
402 0 : ndr_print_enum(ndr, name, "ENUM", v, r);
403 : } else {
404 0 : ndr_print_enum(ndr, name, "ENUM", val, r);
405 : }
406 0 : }
407 :
408 0 : _PUBLIC_ void ndr_print_drsuapi_DsAddEntry_AttrErrListItem_V1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntry_AttrErrListItem_V1 *r)
409 : {
410 0 : ndr_print_struct(ndr, name, "drsuapi_DsAddEntry_AttrErrListItem_V1");
411 0 : ndr->depth++;
412 0 : ndr_print_ptr(ndr, "next", r->next);
413 0 : ndr_print_drsuapi_DsAddEntry_AttrErr_V1(ndr, "err_data", &r->err_data);
414 0 : ndr->depth--;
415 0 : if (r->next) {
416 0 : ndr_print_drsuapi_DsAddEntry_AttrErrListItem_V1(ndr, "next", r->next);
417 : }
418 0 : }
419 :
420 4146 : enum ndr_err_code ndr_push_drsuapi_DsBindInfo(struct ndr_push *ndr, int ndr_flags, const union drsuapi_DsBindInfo *r)
421 : {
422 4146 : uint32_t _flags_save = ndr->flags;
423 4146 : ndr->flags = ndr->flags & ~LIBNDR_FLAG_NDR64;
424 4146 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
425 4146 : if (ndr_flags & NDR_SCALARS) {
426 : uint32_t level;
427 4146 : NDR_CHECK(ndr_push_steal_switch_value(ndr, r, &level));
428 4146 : NDR_CHECK(ndr_push_union_align(ndr, 4));
429 4146 : switch (level) {
430 0 : case 24: {
431 0 : {
432 : struct ndr_push *_ndr_info24;
433 0 : NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_info24, 0, 24));
434 0 : NDR_CHECK(ndr_push_drsuapi_DsBindInfo24(_ndr_info24, NDR_SCALARS, &r->info24));
435 0 : NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info24, 0, 24));
436 : }
437 0 : break; }
438 :
439 4137 : case 28: {
440 3866 : {
441 : struct ndr_push *_ndr_info28;
442 4137 : NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_info28, 0, 28));
443 4137 : NDR_CHECK(ndr_push_drsuapi_DsBindInfo28(_ndr_info28, NDR_SCALARS, &r->info28));
444 4137 : NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info28, 0, 28));
445 : }
446 4137 : break; }
447 :
448 9 : case 48: {
449 9 : {
450 : struct ndr_push *_ndr_info48;
451 9 : NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_info48, 0, 48));
452 9 : NDR_CHECK(ndr_push_drsuapi_DsBindInfo48(_ndr_info48, NDR_SCALARS, &r->info48));
453 9 : NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info48, 0, 48));
454 : }
455 9 : break; }
456 :
457 0 : case 52: {
458 0 : {
459 : struct ndr_push *_ndr_info52;
460 0 : NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_info52, 0, 52));
461 0 : NDR_CHECK(ndr_push_drsuapi_DsBindInfo52(_ndr_info52, NDR_SCALARS, &r->info52));
462 0 : NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info52, 0, 52));
463 : }
464 0 : break; }
465 :
466 0 : default: {
467 0 : {
468 : struct ndr_push *_ndr_Fallback;
469 0 : NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_Fallback, 0, level));
470 0 : NDR_CHECK(ndr_push_drsuapi_DsBindInfoFallBack(_ndr_Fallback, NDR_SCALARS, &r->Fallback));
471 0 : NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_Fallback, 0, level));
472 : }
473 0 : break; }
474 :
475 : }
476 : }
477 4146 : ndr->flags = _flags_save;
478 4146 : return NDR_ERR_SUCCESS;
479 : }
480 :
481 4072 : enum ndr_err_code ndr_pull_drsuapi_DsBindInfo(struct ndr_pull *ndr, int ndr_flags, union drsuapi_DsBindInfo *r)
482 : {
483 4072 : uint32_t _flags_save = ndr->flags;
484 4072 : ndr->flags = ndr->flags & ~LIBNDR_FLAG_NDR64;
485 4072 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
486 4072 : if (ndr_flags & NDR_SCALARS) {
487 : uint32_t level;
488 4072 : NDR_CHECK(ndr_pull_steal_switch_value(ndr, r, &level));
489 4072 : NDR_CHECK(ndr_pull_union_align(ndr, 4));
490 4072 : switch (level) {
491 0 : case 24: {
492 0 : {
493 : struct ndr_pull *_ndr_info24;
494 0 : NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_info24, 0, 24));
495 0 : NDR_CHECK(ndr_pull_drsuapi_DsBindInfo24(_ndr_info24, NDR_SCALARS, &r->info24));
496 0 : NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_info24, 0, 24));
497 : }
498 0 : break; }
499 :
500 4065 : case 28: {
501 3796 : {
502 : struct ndr_pull *_ndr_info28;
503 4065 : NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_info28, 0, 28));
504 4065 : NDR_CHECK(ndr_pull_drsuapi_DsBindInfo28(_ndr_info28, NDR_SCALARS, &r->info28));
505 4065 : NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_info28, 0, 28));
506 : }
507 4065 : break; }
508 :
509 7 : case 48: {
510 7 : {
511 : struct ndr_pull *_ndr_info48;
512 7 : NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_info48, 0, 48));
513 7 : NDR_CHECK(ndr_pull_drsuapi_DsBindInfo48(_ndr_info48, NDR_SCALARS, &r->info48));
514 7 : NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_info48, 0, 48));
515 : }
516 7 : break; }
517 :
518 0 : case 52: {
519 0 : {
520 : struct ndr_pull *_ndr_info52;
521 0 : NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_info52, 0, 52));
522 0 : NDR_CHECK(ndr_pull_drsuapi_DsBindInfo52(_ndr_info52, NDR_SCALARS, &r->info52));
523 0 : NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_info52, 0, 52));
524 : }
525 0 : break; }
526 :
527 0 : default: {
528 0 : {
529 : struct ndr_pull *_ndr_Fallback;
530 0 : NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_Fallback, 0, level));
531 0 : NDR_CHECK(ndr_pull_drsuapi_DsBindInfoFallBack(_ndr_Fallback, NDR_SCALARS, &r->Fallback));
532 0 : NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_Fallback, 0, level));
533 : }
534 0 : break; }
535 :
536 : }
537 : }
538 4072 : ndr->flags = _flags_save;
539 4072 : return NDR_ERR_SUCCESS;
540 : }
541 :
542 140 : _PUBLIC_ void ndr_print_drsuapi_DsBindInfo(struct ndr_print *ndr, const char *name, const union drsuapi_DsBindInfo *r)
543 : {
544 : uint32_t level;
545 140 : level = ndr_print_steal_switch_value(ndr, r);
546 140 : ndr_print_union(ndr, name, level, "drsuapi_DsBindInfo");
547 140 : switch (level) {
548 0 : case 24:
549 0 : ndr_print_drsuapi_DsBindInfo24(ndr, "info24", &r->info24);
550 0 : break;
551 :
552 140 : case 28:
553 140 : ndr_print_drsuapi_DsBindInfo28(ndr, "info28", &r->info28);
554 140 : break;
555 :
556 0 : case 48:
557 0 : ndr_print_drsuapi_DsBindInfo48(ndr, "info48", &r->info48);
558 0 : break;
559 :
560 0 : case 52:
561 0 : ndr_print_drsuapi_DsBindInfo52(ndr, "info52", &r->info52);
562 0 : break;
563 :
564 0 : default:
565 0 : ndr_print_drsuapi_DsBindInfoFallBack(ndr, "Fallback", &r->Fallback);
566 0 : break;
567 :
568 : }
569 140 : }
|