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