use unsigned instead of uint32_t for LDB counters.
[Samba/cd1.git] / librpc / gen_ndr / ndr_xattr.c
blobbbffd50e9fc6b4ad1d53b227d51d4dc71200bc9b
1 /* parser auto-generated by pidl */
3 #include "includes.h"
4 #include "../librpc/gen_ndr/ndr_xattr.h"
6 #include "librpc/gen_ndr/ndr_security.h"
7 static enum ndr_err_code ndr_push_xattr_DosInfoFFFFCompat(struct ndr_push *ndr, int ndr_flags, const struct xattr_DosInfoFFFFCompat *r)
9 if (ndr_flags & NDR_SCALARS) {
10 NDR_CHECK(ndr_push_align(ndr, 4));
11 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->attrib));
12 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
14 if (ndr_flags & NDR_BUFFERS) {
16 return NDR_ERR_SUCCESS;
19 static enum ndr_err_code ndr_pull_xattr_DosInfoFFFFCompat(struct ndr_pull *ndr, int ndr_flags, struct xattr_DosInfoFFFFCompat *r)
21 if (ndr_flags & NDR_SCALARS) {
22 NDR_CHECK(ndr_pull_align(ndr, 4));
23 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->attrib));
24 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
26 if (ndr_flags & NDR_BUFFERS) {
28 return NDR_ERR_SUCCESS;
31 _PUBLIC_ void ndr_print_xattr_DosInfoFFFFCompat(struct ndr_print *ndr, const char *name, const struct xattr_DosInfoFFFFCompat *r)
33 ndr_print_struct(ndr, name, "xattr_DosInfoFFFFCompat");
34 ndr->depth++;
35 ndr_print_uint32(ndr, "attrib", r->attrib);
36 ndr->depth--;
39 static enum ndr_err_code ndr_push_xattr_DosInfo1(struct ndr_push *ndr, int ndr_flags, const struct xattr_DosInfo1 *r)
41 if (ndr_flags & NDR_SCALARS) {
42 NDR_CHECK(ndr_push_align(ndr, 4));
43 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->attrib));
44 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ea_size));
45 NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->size));
46 NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->alloc_size));
47 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->create_time));
48 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->change_time));
49 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
51 if (ndr_flags & NDR_BUFFERS) {
53 return NDR_ERR_SUCCESS;
56 static enum ndr_err_code ndr_pull_xattr_DosInfo1(struct ndr_pull *ndr, int ndr_flags, struct xattr_DosInfo1 *r)
58 if (ndr_flags & NDR_SCALARS) {
59 NDR_CHECK(ndr_pull_align(ndr, 4));
60 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->attrib));
61 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ea_size));
62 NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->size));
63 NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->alloc_size));
64 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->create_time));
65 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->change_time));
66 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
68 if (ndr_flags & NDR_BUFFERS) {
70 return NDR_ERR_SUCCESS;
73 _PUBLIC_ void ndr_print_xattr_DosInfo1(struct ndr_print *ndr, const char *name, const struct xattr_DosInfo1 *r)
75 ndr_print_struct(ndr, name, "xattr_DosInfo1");
76 ndr->depth++;
77 ndr_print_uint32(ndr, "attrib", r->attrib);
78 ndr_print_uint32(ndr, "ea_size", r->ea_size);
79 ndr_print_udlong(ndr, "size", r->size);
80 ndr_print_udlong(ndr, "alloc_size", r->alloc_size);
81 ndr_print_NTTIME(ndr, "create_time", r->create_time);
82 ndr_print_NTTIME(ndr, "change_time", r->change_time);
83 ndr->depth--;
86 static enum ndr_err_code ndr_push_xattr_DosInfo2Old(struct ndr_push *ndr, int ndr_flags, const struct xattr_DosInfo2Old *r)
88 if (ndr_flags & NDR_SCALARS) {
89 NDR_CHECK(ndr_push_align(ndr, 4));
90 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->flags));
91 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->attrib));
92 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ea_size));
93 NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->size));
94 NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->alloc_size));
95 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->create_time));
96 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->change_time));
97 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->write_time));
99 uint32_t _flags_save_string = ndr->flags;
100 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM);
101 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->name));
102 ndr->flags = _flags_save_string;
104 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
106 if (ndr_flags & NDR_BUFFERS) {
108 return NDR_ERR_SUCCESS;
111 static enum ndr_err_code ndr_pull_xattr_DosInfo2Old(struct ndr_pull *ndr, int ndr_flags, struct xattr_DosInfo2Old *r)
113 if (ndr_flags & NDR_SCALARS) {
114 NDR_CHECK(ndr_pull_align(ndr, 4));
115 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->flags));
116 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->attrib));
117 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ea_size));
118 NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->size));
119 NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->alloc_size));
120 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->create_time));
121 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->change_time));
122 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->write_time));
124 uint32_t _flags_save_string = ndr->flags;
125 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM);
126 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->name));
127 ndr->flags = _flags_save_string;
129 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
131 if (ndr_flags & NDR_BUFFERS) {
133 return NDR_ERR_SUCCESS;
136 _PUBLIC_ void ndr_print_xattr_DosInfo2Old(struct ndr_print *ndr, const char *name, const struct xattr_DosInfo2Old *r)
138 ndr_print_struct(ndr, name, "xattr_DosInfo2Old");
139 ndr->depth++;
140 ndr_print_uint32(ndr, "flags", r->flags);
141 ndr_print_uint32(ndr, "attrib", r->attrib);
142 ndr_print_uint32(ndr, "ea_size", r->ea_size);
143 ndr_print_udlong(ndr, "size", r->size);
144 ndr_print_udlong(ndr, "alloc_size", r->alloc_size);
145 ndr_print_NTTIME(ndr, "create_time", r->create_time);
146 ndr_print_NTTIME(ndr, "change_time", r->change_time);
147 ndr_print_NTTIME(ndr, "write_time", r->write_time);
148 ndr_print_string(ndr, "name", r->name);
149 ndr->depth--;
152 static enum ndr_err_code ndr_push_xattr_DosInfoValidFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
154 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
155 return NDR_ERR_SUCCESS;
158 static enum ndr_err_code ndr_pull_xattr_DosInfoValidFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
160 uint32_t v;
161 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
162 *r = v;
163 return NDR_ERR_SUCCESS;
166 _PUBLIC_ void ndr_print_xattr_DosInfoValidFlags(struct ndr_print *ndr, const char *name, uint32_t r)
168 ndr_print_uint32(ndr, name, r);
169 ndr->depth++;
170 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "XATTR_DOSINFO_ATTRIB", XATTR_DOSINFO_ATTRIB, r);
171 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "XATTR_DOSINFO_EA_SIZE", XATTR_DOSINFO_EA_SIZE, r);
172 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "XATTR_DOSINFO_SIZE", XATTR_DOSINFO_SIZE, r);
173 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "XATTR_DOSINFO_ALLOC_SIZE", XATTR_DOSINFO_ALLOC_SIZE, r);
174 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "XATTR_DOSINFO_CREATE_TIME", XATTR_DOSINFO_CREATE_TIME, r);
175 ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "XATTR_DOSINFO_CHANGE_TIME", XATTR_DOSINFO_CHANGE_TIME, r);
176 ndr->depth--;
179 static enum ndr_err_code ndr_push_xattr_DosInfo3(struct ndr_push *ndr, int ndr_flags, const struct xattr_DosInfo3 *r)
181 if (ndr_flags & NDR_SCALARS) {
182 NDR_CHECK(ndr_push_align(ndr, 4));
183 NDR_CHECK(ndr_push_xattr_DosInfoValidFlags(ndr, NDR_SCALARS, r->valid_flags));
184 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->attrib));
185 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ea_size));
186 NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->size));
187 NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->alloc_size));
188 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->create_time));
189 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->change_time));
190 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
192 if (ndr_flags & NDR_BUFFERS) {
194 return NDR_ERR_SUCCESS;
197 static enum ndr_err_code ndr_pull_xattr_DosInfo3(struct ndr_pull *ndr, int ndr_flags, struct xattr_DosInfo3 *r)
199 if (ndr_flags & NDR_SCALARS) {
200 NDR_CHECK(ndr_pull_align(ndr, 4));
201 NDR_CHECK(ndr_pull_xattr_DosInfoValidFlags(ndr, NDR_SCALARS, &r->valid_flags));
202 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->attrib));
203 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ea_size));
204 NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->size));
205 NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->alloc_size));
206 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->create_time));
207 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->change_time));
208 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
210 if (ndr_flags & NDR_BUFFERS) {
212 return NDR_ERR_SUCCESS;
215 _PUBLIC_ void ndr_print_xattr_DosInfo3(struct ndr_print *ndr, const char *name, const struct xattr_DosInfo3 *r)
217 ndr_print_struct(ndr, name, "xattr_DosInfo3");
218 ndr->depth++;
219 ndr_print_xattr_DosInfoValidFlags(ndr, "valid_flags", r->valid_flags);
220 ndr_print_uint32(ndr, "attrib", r->attrib);
221 ndr_print_uint32(ndr, "ea_size", r->ea_size);
222 ndr_print_udlong(ndr, "size", r->size);
223 ndr_print_udlong(ndr, "alloc_size", r->alloc_size);
224 ndr_print_NTTIME(ndr, "create_time", r->create_time);
225 ndr_print_NTTIME(ndr, "change_time", r->change_time);
226 ndr->depth--;
229 _PUBLIC_ enum ndr_err_code ndr_push_xattr_DosInfo(struct ndr_push *ndr, int ndr_flags, const union xattr_DosInfo *r)
231 if (ndr_flags & NDR_SCALARS) {
232 int level = ndr_push_get_switch_value(ndr, r);
233 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level));
234 NDR_CHECK(ndr_push_union_align(ndr, 4));
235 switch (level) {
236 case 0xFFFF: {
237 NDR_CHECK(ndr_push_xattr_DosInfoFFFFCompat(ndr, NDR_SCALARS, &r->compatinfoFFFF));
238 break; }
240 case 1: {
241 NDR_CHECK(ndr_push_xattr_DosInfo1(ndr, NDR_SCALARS, &r->info1));
242 break; }
244 case 2: {
245 NDR_CHECK(ndr_push_xattr_DosInfo2Old(ndr, NDR_SCALARS, &r->oldinfo2));
246 break; }
248 case 3: {
249 NDR_CHECK(ndr_push_xattr_DosInfo3(ndr, NDR_SCALARS, &r->info3));
250 break; }
252 default:
253 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
256 if (ndr_flags & NDR_BUFFERS) {
257 int level = ndr_push_get_switch_value(ndr, r);
258 switch (level) {
259 case 0xFFFF:
260 break;
262 case 1:
263 break;
265 case 2:
266 break;
268 case 3:
269 break;
271 default:
272 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
275 return NDR_ERR_SUCCESS;
278 _PUBLIC_ enum ndr_err_code ndr_pull_xattr_DosInfo(struct ndr_pull *ndr, int ndr_flags, union xattr_DosInfo *r)
280 int level;
281 uint16_t _level;
282 level = ndr_pull_get_switch_value(ndr, r);
283 if (ndr_flags & NDR_SCALARS) {
284 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level));
285 if (_level != level) {
286 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
288 NDR_CHECK(ndr_pull_union_align(ndr, 4));
289 switch (level) {
290 case 0xFFFF: {
291 NDR_CHECK(ndr_pull_xattr_DosInfoFFFFCompat(ndr, NDR_SCALARS, &r->compatinfoFFFF));
292 break; }
294 case 1: {
295 NDR_CHECK(ndr_pull_xattr_DosInfo1(ndr, NDR_SCALARS, &r->info1));
296 break; }
298 case 2: {
299 NDR_CHECK(ndr_pull_xattr_DosInfo2Old(ndr, NDR_SCALARS, &r->oldinfo2));
300 break; }
302 case 3: {
303 NDR_CHECK(ndr_pull_xattr_DosInfo3(ndr, NDR_SCALARS, &r->info3));
304 break; }
306 default:
307 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
310 if (ndr_flags & NDR_BUFFERS) {
311 switch (level) {
312 case 0xFFFF:
313 break;
315 case 1:
316 break;
318 case 2:
319 break;
321 case 3:
322 break;
324 default:
325 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
328 return NDR_ERR_SUCCESS;
331 _PUBLIC_ void ndr_print_xattr_DosInfo(struct ndr_print *ndr, const char *name, const union xattr_DosInfo *r)
333 int level;
334 level = ndr_print_get_switch_value(ndr, r);
335 ndr_print_union(ndr, name, level, "xattr_DosInfo");
336 switch (level) {
337 case 0xFFFF:
338 ndr_print_xattr_DosInfoFFFFCompat(ndr, "compatinfoFFFF", &r->compatinfoFFFF);
339 break;
341 case 1:
342 ndr_print_xattr_DosInfo1(ndr, "info1", &r->info1);
343 break;
345 case 2:
346 ndr_print_xattr_DosInfo2Old(ndr, "oldinfo2", &r->oldinfo2);
347 break;
349 case 3:
350 ndr_print_xattr_DosInfo3(ndr, "info3", &r->info3);
351 break;
353 default:
354 ndr_print_bad_level(ndr, name, level);
358 _PUBLIC_ enum ndr_err_code ndr_push_xattr_DosAttrib(struct ndr_push *ndr, int ndr_flags, const struct xattr_DosAttrib *r)
360 if (ndr_flags & NDR_SCALARS) {
361 NDR_CHECK(ndr_push_align(ndr, 4));
362 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->version));
363 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->info, r->version));
364 NDR_CHECK(ndr_push_xattr_DosInfo(ndr, NDR_SCALARS, &r->info));
365 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
367 if (ndr_flags & NDR_BUFFERS) {
369 return NDR_ERR_SUCCESS;
372 _PUBLIC_ enum ndr_err_code ndr_pull_xattr_DosAttrib(struct ndr_pull *ndr, int ndr_flags, struct xattr_DosAttrib *r)
374 if (ndr_flags & NDR_SCALARS) {
375 NDR_CHECK(ndr_pull_align(ndr, 4));
376 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->version));
377 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->info, r->version));
378 NDR_CHECK(ndr_pull_xattr_DosInfo(ndr, NDR_SCALARS, &r->info));
379 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
381 if (ndr_flags & NDR_BUFFERS) {
383 return NDR_ERR_SUCCESS;
386 _PUBLIC_ void ndr_print_xattr_DosAttrib(struct ndr_print *ndr, const char *name, const struct xattr_DosAttrib *r)
388 ndr_print_struct(ndr, name, "xattr_DosAttrib");
389 ndr->depth++;
390 ndr_print_uint16(ndr, "version", r->version);
391 ndr_print_set_switch_value(ndr, &r->info, r->version);
392 ndr_print_xattr_DosInfo(ndr, "info", &r->info);
393 ndr->depth--;
396 static enum ndr_err_code ndr_push_xattr_EA(struct ndr_push *ndr, int ndr_flags, const struct xattr_EA *r)
398 if (ndr_flags & NDR_SCALARS) {
399 NDR_CHECK(ndr_push_align(ndr, 4));
401 uint32_t _flags_save_string = ndr->flags;
402 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM);
403 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->name));
404 ndr->flags = _flags_save_string;
406 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->value));
407 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
409 if (ndr_flags & NDR_BUFFERS) {
411 return NDR_ERR_SUCCESS;
414 static enum ndr_err_code ndr_pull_xattr_EA(struct ndr_pull *ndr, int ndr_flags, struct xattr_EA *r)
416 if (ndr_flags & NDR_SCALARS) {
417 NDR_CHECK(ndr_pull_align(ndr, 4));
419 uint32_t _flags_save_string = ndr->flags;
420 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM);
421 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->name));
422 ndr->flags = _flags_save_string;
424 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->value));
425 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
427 if (ndr_flags & NDR_BUFFERS) {
429 return NDR_ERR_SUCCESS;
432 _PUBLIC_ void ndr_print_xattr_EA(struct ndr_print *ndr, const char *name, const struct xattr_EA *r)
434 ndr_print_struct(ndr, name, "xattr_EA");
435 ndr->depth++;
436 ndr_print_string(ndr, "name", r->name);
437 ndr_print_DATA_BLOB(ndr, "value", r->value);
438 ndr->depth--;
441 _PUBLIC_ enum ndr_err_code ndr_push_xattr_DosEAs(struct ndr_push *ndr, int ndr_flags, const struct xattr_DosEAs *r)
443 uint32_t cntr_eas_1;
444 if (ndr_flags & NDR_SCALARS) {
445 NDR_CHECK(ndr_push_align(ndr, 5));
446 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->num_eas));
447 NDR_CHECK(ndr_push_unique_ptr(ndr, r->eas));
448 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
450 if (ndr_flags & NDR_BUFFERS) {
451 if (r->eas) {
452 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->num_eas));
453 for (cntr_eas_1 = 0; cntr_eas_1 < r->num_eas; cntr_eas_1++) {
454 NDR_CHECK(ndr_push_xattr_EA(ndr, NDR_SCALARS, &r->eas[cntr_eas_1]));
458 return NDR_ERR_SUCCESS;
461 _PUBLIC_ enum ndr_err_code ndr_pull_xattr_DosEAs(struct ndr_pull *ndr, int ndr_flags, struct xattr_DosEAs *r)
463 uint32_t _ptr_eas;
464 uint32_t cntr_eas_1;
465 TALLOC_CTX *_mem_save_eas_0;
466 TALLOC_CTX *_mem_save_eas_1;
467 if (ndr_flags & NDR_SCALARS) {
468 NDR_CHECK(ndr_pull_align(ndr, 5));
469 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->num_eas));
470 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_eas));
471 if (_ptr_eas) {
472 NDR_PULL_ALLOC(ndr, r->eas);
473 } else {
474 r->eas = NULL;
476 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
478 if (ndr_flags & NDR_BUFFERS) {
479 if (r->eas) {
480 _mem_save_eas_0 = NDR_PULL_GET_MEM_CTX(ndr);
481 NDR_PULL_SET_MEM_CTX(ndr, r->eas, 0);
482 NDR_CHECK(ndr_pull_array_size(ndr, &r->eas));
483 NDR_PULL_ALLOC_N(ndr, r->eas, ndr_get_array_size(ndr, &r->eas));
484 _mem_save_eas_1 = NDR_PULL_GET_MEM_CTX(ndr);
485 NDR_PULL_SET_MEM_CTX(ndr, r->eas, 0);
486 for (cntr_eas_1 = 0; cntr_eas_1 < r->num_eas; cntr_eas_1++) {
487 NDR_CHECK(ndr_pull_xattr_EA(ndr, NDR_SCALARS, &r->eas[cntr_eas_1]));
489 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_eas_1, 0);
490 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_eas_0, 0);
492 if (r->eas) {
493 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->eas, r->num_eas));
496 return NDR_ERR_SUCCESS;
499 _PUBLIC_ void ndr_print_xattr_DosEAs(struct ndr_print *ndr, const char *name, const struct xattr_DosEAs *r)
501 uint32_t cntr_eas_1;
502 ndr_print_struct(ndr, name, "xattr_DosEAs");
503 ndr->depth++;
504 ndr_print_uint16(ndr, "num_eas", r->num_eas);
505 ndr_print_ptr(ndr, "eas", r->eas);
506 ndr->depth++;
507 if (r->eas) {
508 ndr->print(ndr, "%s: ARRAY(%d)", "eas", (int)r->num_eas);
509 ndr->depth++;
510 for (cntr_eas_1=0;cntr_eas_1<r->num_eas;cntr_eas_1++) {
511 char *idx_1=NULL;
512 if (asprintf(&idx_1, "[%d]", cntr_eas_1) != -1) {
513 ndr_print_xattr_EA(ndr, "eas", &r->eas[cntr_eas_1]);
514 free(idx_1);
517 ndr->depth--;
519 ndr->depth--;
520 ndr->depth--;
523 _PUBLIC_ enum ndr_err_code ndr_push_tdb_xattrs(struct ndr_push *ndr, int ndr_flags, const struct tdb_xattrs *r)
525 uint32_t cntr_eas_0;
526 if (ndr_flags & NDR_SCALARS) {
527 NDR_CHECK(ndr_push_align(ndr, 4));
528 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_eas));
529 for (cntr_eas_0 = 0; cntr_eas_0 < r->num_eas; cntr_eas_0++) {
530 NDR_CHECK(ndr_push_xattr_EA(ndr, NDR_SCALARS, &r->eas[cntr_eas_0]));
532 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
534 if (ndr_flags & NDR_BUFFERS) {
536 return NDR_ERR_SUCCESS;
539 _PUBLIC_ enum ndr_err_code ndr_pull_tdb_xattrs(struct ndr_pull *ndr, int ndr_flags, struct tdb_xattrs *r)
541 uint32_t cntr_eas_0;
542 TALLOC_CTX *_mem_save_eas_0;
543 if (ndr_flags & NDR_SCALARS) {
544 NDR_CHECK(ndr_pull_align(ndr, 4));
545 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_eas));
546 NDR_PULL_ALLOC_N(ndr, r->eas, r->num_eas);
547 _mem_save_eas_0 = NDR_PULL_GET_MEM_CTX(ndr);
548 NDR_PULL_SET_MEM_CTX(ndr, r->eas, 0);
549 for (cntr_eas_0 = 0; cntr_eas_0 < r->num_eas; cntr_eas_0++) {
550 NDR_CHECK(ndr_pull_xattr_EA(ndr, NDR_SCALARS, &r->eas[cntr_eas_0]));
552 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_eas_0, 0);
553 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
555 if (ndr_flags & NDR_BUFFERS) {
557 return NDR_ERR_SUCCESS;
560 _PUBLIC_ void ndr_print_tdb_xattrs(struct ndr_print *ndr, const char *name, const struct tdb_xattrs *r)
562 uint32_t cntr_eas_0;
563 ndr_print_struct(ndr, name, "tdb_xattrs");
564 ndr->depth++;
565 ndr_print_uint32(ndr, "num_eas", r->num_eas);
566 ndr->print(ndr, "%s: ARRAY(%d)", "eas", (int)r->num_eas);
567 ndr->depth++;
568 for (cntr_eas_0=0;cntr_eas_0<r->num_eas;cntr_eas_0++) {
569 char *idx_0=NULL;
570 if (asprintf(&idx_0, "[%d]", cntr_eas_0) != -1) {
571 ndr_print_xattr_EA(ndr, "eas", &r->eas[cntr_eas_0]);
572 free(idx_0);
575 ndr->depth--;
576 ndr->depth--;
579 static enum ndr_err_code ndr_push_xattr_DosStream(struct ndr_push *ndr, int ndr_flags, const struct xattr_DosStream *r)
581 if (ndr_flags & NDR_SCALARS) {
582 NDR_CHECK(ndr_push_align(ndr, 4));
583 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->flags));
584 NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->size));
585 NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->alloc_size));
587 uint32_t _flags_save_string = ndr->flags;
588 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM);
589 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->name));
590 ndr->flags = _flags_save_string;
592 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
594 if (ndr_flags & NDR_BUFFERS) {
596 return NDR_ERR_SUCCESS;
599 static enum ndr_err_code ndr_pull_xattr_DosStream(struct ndr_pull *ndr, int ndr_flags, struct xattr_DosStream *r)
601 if (ndr_flags & NDR_SCALARS) {
602 NDR_CHECK(ndr_pull_align(ndr, 4));
603 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->flags));
604 NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->size));
605 NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->alloc_size));
607 uint32_t _flags_save_string = ndr->flags;
608 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM);
609 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->name));
610 ndr->flags = _flags_save_string;
612 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
614 if (ndr_flags & NDR_BUFFERS) {
616 return NDR_ERR_SUCCESS;
619 _PUBLIC_ void ndr_print_xattr_DosStream(struct ndr_print *ndr, const char *name, const struct xattr_DosStream *r)
621 ndr_print_struct(ndr, name, "xattr_DosStream");
622 ndr->depth++;
623 ndr_print_uint32(ndr, "flags", r->flags);
624 ndr_print_udlong(ndr, "size", r->size);
625 ndr_print_udlong(ndr, "alloc_size", r->alloc_size);
626 ndr_print_string(ndr, "name", r->name);
627 ndr->depth--;
630 _PUBLIC_ enum ndr_err_code ndr_push_xattr_DosStreams(struct ndr_push *ndr, int ndr_flags, const struct xattr_DosStreams *r)
632 uint32_t cntr_streams_1;
633 if (ndr_flags & NDR_SCALARS) {
634 NDR_CHECK(ndr_push_align(ndr, 5));
635 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_streams));
636 NDR_CHECK(ndr_push_unique_ptr(ndr, r->streams));
637 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
639 if (ndr_flags & NDR_BUFFERS) {
640 if (r->streams) {
641 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->num_streams));
642 for (cntr_streams_1 = 0; cntr_streams_1 < r->num_streams; cntr_streams_1++) {
643 NDR_CHECK(ndr_push_xattr_DosStream(ndr, NDR_SCALARS, &r->streams[cntr_streams_1]));
647 return NDR_ERR_SUCCESS;
650 _PUBLIC_ enum ndr_err_code ndr_pull_xattr_DosStreams(struct ndr_pull *ndr, int ndr_flags, struct xattr_DosStreams *r)
652 uint32_t _ptr_streams;
653 uint32_t cntr_streams_1;
654 TALLOC_CTX *_mem_save_streams_0;
655 TALLOC_CTX *_mem_save_streams_1;
656 if (ndr_flags & NDR_SCALARS) {
657 NDR_CHECK(ndr_pull_align(ndr, 5));
658 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_streams));
659 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_streams));
660 if (_ptr_streams) {
661 NDR_PULL_ALLOC(ndr, r->streams);
662 } else {
663 r->streams = NULL;
665 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
667 if (ndr_flags & NDR_BUFFERS) {
668 if (r->streams) {
669 _mem_save_streams_0 = NDR_PULL_GET_MEM_CTX(ndr);
670 NDR_PULL_SET_MEM_CTX(ndr, r->streams, 0);
671 NDR_CHECK(ndr_pull_array_size(ndr, &r->streams));
672 NDR_PULL_ALLOC_N(ndr, r->streams, ndr_get_array_size(ndr, &r->streams));
673 _mem_save_streams_1 = NDR_PULL_GET_MEM_CTX(ndr);
674 NDR_PULL_SET_MEM_CTX(ndr, r->streams, 0);
675 for (cntr_streams_1 = 0; cntr_streams_1 < r->num_streams; cntr_streams_1++) {
676 NDR_CHECK(ndr_pull_xattr_DosStream(ndr, NDR_SCALARS, &r->streams[cntr_streams_1]));
678 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_streams_1, 0);
679 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_streams_0, 0);
681 if (r->streams) {
682 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->streams, r->num_streams));
685 return NDR_ERR_SUCCESS;
688 _PUBLIC_ void ndr_print_xattr_DosStreams(struct ndr_print *ndr, const char *name, const struct xattr_DosStreams *r)
690 uint32_t cntr_streams_1;
691 ndr_print_struct(ndr, name, "xattr_DosStreams");
692 ndr->depth++;
693 ndr_print_uint32(ndr, "num_streams", r->num_streams);
694 ndr_print_ptr(ndr, "streams", r->streams);
695 ndr->depth++;
696 if (r->streams) {
697 ndr->print(ndr, "%s: ARRAY(%d)", "streams", (int)r->num_streams);
698 ndr->depth++;
699 for (cntr_streams_1=0;cntr_streams_1<r->num_streams;cntr_streams_1++) {
700 char *idx_1=NULL;
701 if (asprintf(&idx_1, "[%d]", cntr_streams_1) != -1) {
702 ndr_print_xattr_DosStream(ndr, "streams", &r->streams[cntr_streams_1]);
703 free(idx_1);
706 ndr->depth--;
708 ndr->depth--;
709 ndr->depth--;
712 _PUBLIC_ enum ndr_err_code ndr_push_security_descriptor_hash_v2(struct ndr_push *ndr, int ndr_flags, const struct security_descriptor_hash_v2 *r)
714 if (ndr_flags & NDR_SCALARS) {
715 NDR_CHECK(ndr_push_align(ndr, 5));
716 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sd));
717 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->hash, 16));
718 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
720 if (ndr_flags & NDR_BUFFERS) {
721 if (r->sd) {
722 NDR_CHECK(ndr_push_security_descriptor(ndr, NDR_SCALARS|NDR_BUFFERS, r->sd));
725 return NDR_ERR_SUCCESS;
728 _PUBLIC_ enum ndr_err_code ndr_pull_security_descriptor_hash_v2(struct ndr_pull *ndr, int ndr_flags, struct security_descriptor_hash_v2 *r)
730 uint32_t _ptr_sd;
731 TALLOC_CTX *_mem_save_sd_0;
732 if (ndr_flags & NDR_SCALARS) {
733 NDR_CHECK(ndr_pull_align(ndr, 5));
734 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sd));
735 if (_ptr_sd) {
736 NDR_PULL_ALLOC(ndr, r->sd);
737 } else {
738 r->sd = NULL;
740 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->hash, 16));
741 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
743 if (ndr_flags & NDR_BUFFERS) {
744 if (r->sd) {
745 _mem_save_sd_0 = NDR_PULL_GET_MEM_CTX(ndr);
746 NDR_PULL_SET_MEM_CTX(ndr, r->sd, 0);
747 NDR_CHECK(ndr_pull_security_descriptor(ndr, NDR_SCALARS|NDR_BUFFERS, r->sd));
748 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sd_0, 0);
751 return NDR_ERR_SUCCESS;
754 _PUBLIC_ void ndr_print_security_descriptor_hash_v2(struct ndr_print *ndr, const char *name, const struct security_descriptor_hash_v2 *r)
756 ndr_print_struct(ndr, name, "security_descriptor_hash_v2");
757 ndr->depth++;
758 ndr_print_ptr(ndr, "sd", r->sd);
759 ndr->depth++;
760 if (r->sd) {
761 ndr_print_security_descriptor(ndr, "sd", r->sd);
763 ndr->depth--;
764 ndr_print_array_uint8(ndr, "hash", r->hash, 16);
765 ndr->depth--;
768 _PUBLIC_ enum ndr_err_code ndr_push_security_descriptor_hash_v3(struct ndr_push *ndr, int ndr_flags, const struct security_descriptor_hash_v3 *r)
770 if (ndr_flags & NDR_SCALARS) {
771 NDR_CHECK(ndr_push_align(ndr, 5));
772 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sd));
773 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->hash_type));
774 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->hash, 64));
775 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
777 if (ndr_flags & NDR_BUFFERS) {
778 if (r->sd) {
779 NDR_CHECK(ndr_push_security_descriptor(ndr, NDR_SCALARS|NDR_BUFFERS, r->sd));
782 return NDR_ERR_SUCCESS;
785 _PUBLIC_ enum ndr_err_code ndr_pull_security_descriptor_hash_v3(struct ndr_pull *ndr, int ndr_flags, struct security_descriptor_hash_v3 *r)
787 uint32_t _ptr_sd;
788 TALLOC_CTX *_mem_save_sd_0;
789 if (ndr_flags & NDR_SCALARS) {
790 NDR_CHECK(ndr_pull_align(ndr, 5));
791 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sd));
792 if (_ptr_sd) {
793 NDR_PULL_ALLOC(ndr, r->sd);
794 } else {
795 r->sd = NULL;
797 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->hash_type));
798 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->hash, 64));
799 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
801 if (ndr_flags & NDR_BUFFERS) {
802 if (r->sd) {
803 _mem_save_sd_0 = NDR_PULL_GET_MEM_CTX(ndr);
804 NDR_PULL_SET_MEM_CTX(ndr, r->sd, 0);
805 NDR_CHECK(ndr_pull_security_descriptor(ndr, NDR_SCALARS|NDR_BUFFERS, r->sd));
806 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sd_0, 0);
809 return NDR_ERR_SUCCESS;
812 _PUBLIC_ void ndr_print_security_descriptor_hash_v3(struct ndr_print *ndr, const char *name, const struct security_descriptor_hash_v3 *r)
814 ndr_print_struct(ndr, name, "security_descriptor_hash_v3");
815 ndr->depth++;
816 ndr_print_ptr(ndr, "sd", r->sd);
817 ndr->depth++;
818 if (r->sd) {
819 ndr_print_security_descriptor(ndr, "sd", r->sd);
821 ndr->depth--;
822 ndr_print_uint16(ndr, "hash_type", r->hash_type);
823 ndr_print_array_uint8(ndr, "hash", r->hash, 64);
824 ndr->depth--;
827 static enum ndr_err_code ndr_push_xattr_NTACL_Info(struct ndr_push *ndr, int ndr_flags, const union xattr_NTACL_Info *r)
829 if (ndr_flags & NDR_SCALARS) {
830 int level = ndr_push_get_switch_value(ndr, r);
831 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level));
832 NDR_CHECK(ndr_push_union_align(ndr, 5));
833 switch (level) {
834 case 1: {
835 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sd));
836 break; }
838 case 2: {
839 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sd_hs2));
840 break; }
842 case 3: {
843 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sd_hs3));
844 break; }
846 default:
847 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
850 if (ndr_flags & NDR_BUFFERS) {
851 int level = ndr_push_get_switch_value(ndr, r);
852 switch (level) {
853 case 1:
854 if (r->sd) {
855 NDR_CHECK(ndr_push_security_descriptor(ndr, NDR_SCALARS|NDR_BUFFERS, r->sd));
857 break;
859 case 2:
860 if (r->sd_hs2) {
861 NDR_CHECK(ndr_push_security_descriptor_hash_v2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sd_hs2));
863 break;
865 case 3:
866 if (r->sd_hs3) {
867 NDR_CHECK(ndr_push_security_descriptor_hash_v3(ndr, NDR_SCALARS|NDR_BUFFERS, r->sd_hs3));
869 break;
871 default:
872 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
875 return NDR_ERR_SUCCESS;
878 static enum ndr_err_code ndr_pull_xattr_NTACL_Info(struct ndr_pull *ndr, int ndr_flags, union xattr_NTACL_Info *r)
880 int level;
881 uint16_t _level;
882 TALLOC_CTX *_mem_save_sd_0;
883 TALLOC_CTX *_mem_save_sd_hs2_0;
884 TALLOC_CTX *_mem_save_sd_hs3_0;
885 level = ndr_pull_get_switch_value(ndr, r);
886 if (ndr_flags & NDR_SCALARS) {
887 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level));
888 if (_level != level) {
889 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
891 NDR_CHECK(ndr_pull_union_align(ndr, 5));
892 switch (level) {
893 case 1: {
894 uint32_t _ptr_sd;
895 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sd));
896 if (_ptr_sd) {
897 NDR_PULL_ALLOC(ndr, r->sd);
898 } else {
899 r->sd = NULL;
901 break; }
903 case 2: {
904 uint32_t _ptr_sd_hs2;
905 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sd_hs2));
906 if (_ptr_sd_hs2) {
907 NDR_PULL_ALLOC(ndr, r->sd_hs2);
908 } else {
909 r->sd_hs2 = NULL;
911 break; }
913 case 3: {
914 uint32_t _ptr_sd_hs3;
915 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sd_hs3));
916 if (_ptr_sd_hs3) {
917 NDR_PULL_ALLOC(ndr, r->sd_hs3);
918 } else {
919 r->sd_hs3 = NULL;
921 break; }
923 default:
924 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
927 if (ndr_flags & NDR_BUFFERS) {
928 switch (level) {
929 case 1:
930 if (r->sd) {
931 _mem_save_sd_0 = NDR_PULL_GET_MEM_CTX(ndr);
932 NDR_PULL_SET_MEM_CTX(ndr, r->sd, 0);
933 NDR_CHECK(ndr_pull_security_descriptor(ndr, NDR_SCALARS|NDR_BUFFERS, r->sd));
934 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sd_0, 0);
936 break;
938 case 2:
939 if (r->sd_hs2) {
940 _mem_save_sd_hs2_0 = NDR_PULL_GET_MEM_CTX(ndr);
941 NDR_PULL_SET_MEM_CTX(ndr, r->sd_hs2, 0);
942 NDR_CHECK(ndr_pull_security_descriptor_hash_v2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sd_hs2));
943 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sd_hs2_0, 0);
945 break;
947 case 3:
948 if (r->sd_hs3) {
949 _mem_save_sd_hs3_0 = NDR_PULL_GET_MEM_CTX(ndr);
950 NDR_PULL_SET_MEM_CTX(ndr, r->sd_hs3, 0);
951 NDR_CHECK(ndr_pull_security_descriptor_hash_v3(ndr, NDR_SCALARS|NDR_BUFFERS, r->sd_hs3));
952 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sd_hs3_0, 0);
954 break;
956 default:
957 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
960 return NDR_ERR_SUCCESS;
963 _PUBLIC_ void ndr_print_xattr_NTACL_Info(struct ndr_print *ndr, const char *name, const union xattr_NTACL_Info *r)
965 int level;
966 level = ndr_print_get_switch_value(ndr, r);
967 ndr_print_union(ndr, name, level, "xattr_NTACL_Info");
968 switch (level) {
969 case 1:
970 ndr_print_ptr(ndr, "sd", r->sd);
971 ndr->depth++;
972 if (r->sd) {
973 ndr_print_security_descriptor(ndr, "sd", r->sd);
975 ndr->depth--;
976 break;
978 case 2:
979 ndr_print_ptr(ndr, "sd_hs2", r->sd_hs2);
980 ndr->depth++;
981 if (r->sd_hs2) {
982 ndr_print_security_descriptor_hash_v2(ndr, "sd_hs2", r->sd_hs2);
984 ndr->depth--;
985 break;
987 case 3:
988 ndr_print_ptr(ndr, "sd_hs3", r->sd_hs3);
989 ndr->depth++;
990 if (r->sd_hs3) {
991 ndr_print_security_descriptor_hash_v3(ndr, "sd_hs3", r->sd_hs3);
993 ndr->depth--;
994 break;
996 default:
997 ndr_print_bad_level(ndr, name, level);
1001 _PUBLIC_ enum ndr_err_code ndr_push_xattr_NTACL(struct ndr_push *ndr, int ndr_flags, const struct xattr_NTACL *r)
1003 if (ndr_flags & NDR_SCALARS) {
1004 NDR_CHECK(ndr_push_align(ndr, 5));
1005 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->version));
1006 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->info, r->version));
1007 NDR_CHECK(ndr_push_xattr_NTACL_Info(ndr, NDR_SCALARS, &r->info));
1008 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
1010 if (ndr_flags & NDR_BUFFERS) {
1011 NDR_CHECK(ndr_push_xattr_NTACL_Info(ndr, NDR_BUFFERS, &r->info));
1013 return NDR_ERR_SUCCESS;
1016 _PUBLIC_ enum ndr_err_code ndr_pull_xattr_NTACL(struct ndr_pull *ndr, int ndr_flags, struct xattr_NTACL *r)
1018 if (ndr_flags & NDR_SCALARS) {
1019 NDR_CHECK(ndr_pull_align(ndr, 5));
1020 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->version));
1021 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->info, r->version));
1022 NDR_CHECK(ndr_pull_xattr_NTACL_Info(ndr, NDR_SCALARS, &r->info));
1023 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
1025 if (ndr_flags & NDR_BUFFERS) {
1026 NDR_CHECK(ndr_pull_xattr_NTACL_Info(ndr, NDR_BUFFERS, &r->info));
1028 return NDR_ERR_SUCCESS;
1031 _PUBLIC_ void ndr_print_xattr_NTACL(struct ndr_print *ndr, const char *name, const struct xattr_NTACL *r)
1033 ndr_print_struct(ndr, name, "xattr_NTACL");
1034 ndr->depth++;
1035 ndr_print_uint16(ndr, "version", r->version);
1036 ndr_print_set_switch_value(ndr, &r->info, r->version);
1037 ndr_print_xattr_NTACL_Info(ndr, "info", &r->info);
1038 ndr->depth--;
1041 static enum ndr_err_code ndr_push_xattr_parse_DOSATTRIB(struct ndr_push *ndr, int flags, const struct xattr_parse_DOSATTRIB *r)
1043 if (flags & NDR_IN) {
1044 NDR_CHECK(ndr_push_xattr_DOSATTRIB(ndr, NDR_SCALARS, &r->in.x));
1046 if (flags & NDR_OUT) {
1048 return NDR_ERR_SUCCESS;
1051 static enum ndr_err_code ndr_pull_xattr_parse_DOSATTRIB(struct ndr_pull *ndr, int flags, struct xattr_parse_DOSATTRIB *r)
1053 if (flags & NDR_IN) {
1054 NDR_CHECK(ndr_pull_xattr_DOSATTRIB(ndr, NDR_SCALARS, &r->in.x));
1056 if (flags & NDR_OUT) {
1058 return NDR_ERR_SUCCESS;
1061 _PUBLIC_ void ndr_print_xattr_parse_DOSATTRIB(struct ndr_print *ndr, const char *name, int flags, const struct xattr_parse_DOSATTRIB *r)
1063 ndr_print_struct(ndr, name, "xattr_parse_DOSATTRIB");
1064 ndr->depth++;
1065 if (flags & NDR_SET_VALUES) {
1066 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1068 if (flags & NDR_IN) {
1069 ndr_print_struct(ndr, "in", "xattr_parse_DOSATTRIB");
1070 ndr->depth++;
1071 ndr_print_xattr_DOSATTRIB(ndr, "x", &r->in.x);
1072 ndr->depth--;
1074 if (flags & NDR_OUT) {
1075 ndr_print_struct(ndr, "out", "xattr_parse_DOSATTRIB");
1076 ndr->depth++;
1077 ndr->depth--;
1079 ndr->depth--;
1082 static const struct ndr_interface_call xattr_calls[] = {
1084 "xattr_parse_DOSATTRIB",
1085 sizeof(struct xattr_parse_DOSATTRIB),
1086 (ndr_push_flags_fn_t) ndr_push_xattr_parse_DOSATTRIB,
1087 (ndr_pull_flags_fn_t) ndr_pull_xattr_parse_DOSATTRIB,
1088 (ndr_print_function_t) ndr_print_xattr_parse_DOSATTRIB,
1089 false,
1091 { NULL, 0, NULL, NULL, NULL, false }
1094 static const char * const xattr_endpoint_strings[] = {
1095 "ncacn_np:[\\pipe\\xattr]",
1098 static const struct ndr_interface_string_array xattr_endpoints = {
1099 .count = 1,
1100 .names = xattr_endpoint_strings
1103 static const char * const xattr_authservice_strings[] = {
1104 "host",
1107 static const struct ndr_interface_string_array xattr_authservices = {
1108 .count = 1,
1109 .names = xattr_authservice_strings
1113 const struct ndr_interface_table ndr_table_xattr = {
1114 .name = "xattr",
1115 .syntax_id = {
1116 {0x12345778,0x1234,0xabcd,{0x00,0x01},{0x00,0x00,0x00,0x02}},
1117 NDR_XATTR_VERSION
1119 .helpstring = NDR_XATTR_HELPSTRING,
1120 .num_calls = 1,
1121 .calls = xattr_calls,
1122 .endpoints = &xattr_endpoints,
1123 .authservices = &xattr_authservices