1 /* parser auto-generated by pidl */
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_DosInfo1(struct ndr_push
*ndr
, int ndr_flags
, const struct xattr_DosInfo1
*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_uint32(ndr
, NDR_SCALARS
, r
->ea_size
));
13 NDR_CHECK(ndr_push_udlong(ndr
, NDR_SCALARS
, r
->size
));
14 NDR_CHECK(ndr_push_udlong(ndr
, NDR_SCALARS
, r
->alloc_size
));
15 NDR_CHECK(ndr_push_NTTIME(ndr
, NDR_SCALARS
, r
->create_time
));
16 NDR_CHECK(ndr_push_NTTIME(ndr
, NDR_SCALARS
, r
->change_time
));
18 if (ndr_flags
& NDR_BUFFERS
) {
20 return NDR_ERR_SUCCESS
;
23 static enum ndr_err_code
ndr_pull_xattr_DosInfo1(struct ndr_pull
*ndr
, int ndr_flags
, struct xattr_DosInfo1
*r
)
25 if (ndr_flags
& NDR_SCALARS
) {
26 NDR_CHECK(ndr_pull_align(ndr
, 4));
27 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->attrib
));
28 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->ea_size
));
29 NDR_CHECK(ndr_pull_udlong(ndr
, NDR_SCALARS
, &r
->size
));
30 NDR_CHECK(ndr_pull_udlong(ndr
, NDR_SCALARS
, &r
->alloc_size
));
31 NDR_CHECK(ndr_pull_NTTIME(ndr
, NDR_SCALARS
, &r
->create_time
));
32 NDR_CHECK(ndr_pull_NTTIME(ndr
, NDR_SCALARS
, &r
->change_time
));
34 if (ndr_flags
& NDR_BUFFERS
) {
36 return NDR_ERR_SUCCESS
;
39 _PUBLIC_
void ndr_print_xattr_DosInfo1(struct ndr_print
*ndr
, const char *name
, const struct xattr_DosInfo1
*r
)
41 ndr_print_struct(ndr
, name
, "xattr_DosInfo1");
43 ndr_print_uint32(ndr
, "attrib", r
->attrib
);
44 ndr_print_uint32(ndr
, "ea_size", r
->ea_size
);
45 ndr_print_udlong(ndr
, "size", r
->size
);
46 ndr_print_udlong(ndr
, "alloc_size", r
->alloc_size
);
47 ndr_print_NTTIME(ndr
, "create_time", r
->create_time
);
48 ndr_print_NTTIME(ndr
, "change_time", r
->change_time
);
52 static enum ndr_err_code
ndr_push_xattr_DosInfo2Old(struct ndr_push
*ndr
, int ndr_flags
, const struct xattr_DosInfo2Old
*r
)
54 if (ndr_flags
& NDR_SCALARS
) {
55 NDR_CHECK(ndr_push_align(ndr
, 4));
56 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->flags
));
57 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->attrib
));
58 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->ea_size
));
59 NDR_CHECK(ndr_push_udlong(ndr
, NDR_SCALARS
, r
->size
));
60 NDR_CHECK(ndr_push_udlong(ndr
, NDR_SCALARS
, r
->alloc_size
));
61 NDR_CHECK(ndr_push_NTTIME(ndr
, NDR_SCALARS
, r
->create_time
));
62 NDR_CHECK(ndr_push_NTTIME(ndr
, NDR_SCALARS
, r
->change_time
));
63 NDR_CHECK(ndr_push_NTTIME(ndr
, NDR_SCALARS
, r
->write_time
));
65 uint32_t _flags_save_string
= ndr
->flags
;
66 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_STR_UTF8
|LIBNDR_FLAG_STR_NULLTERM
);
67 NDR_CHECK(ndr_push_string(ndr
, NDR_SCALARS
, r
->name
));
68 ndr
->flags
= _flags_save_string
;
71 if (ndr_flags
& NDR_BUFFERS
) {
73 return NDR_ERR_SUCCESS
;
76 static enum ndr_err_code
ndr_pull_xattr_DosInfo2Old(struct ndr_pull
*ndr
, int ndr_flags
, struct xattr_DosInfo2Old
*r
)
78 if (ndr_flags
& NDR_SCALARS
) {
79 NDR_CHECK(ndr_pull_align(ndr
, 4));
80 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->flags
));
81 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->attrib
));
82 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->ea_size
));
83 NDR_CHECK(ndr_pull_udlong(ndr
, NDR_SCALARS
, &r
->size
));
84 NDR_CHECK(ndr_pull_udlong(ndr
, NDR_SCALARS
, &r
->alloc_size
));
85 NDR_CHECK(ndr_pull_NTTIME(ndr
, NDR_SCALARS
, &r
->create_time
));
86 NDR_CHECK(ndr_pull_NTTIME(ndr
, NDR_SCALARS
, &r
->change_time
));
87 NDR_CHECK(ndr_pull_NTTIME(ndr
, NDR_SCALARS
, &r
->write_time
));
89 uint32_t _flags_save_string
= ndr
->flags
;
90 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_STR_UTF8
|LIBNDR_FLAG_STR_NULLTERM
);
91 NDR_CHECK(ndr_pull_string(ndr
, NDR_SCALARS
, &r
->name
));
92 ndr
->flags
= _flags_save_string
;
95 if (ndr_flags
& NDR_BUFFERS
) {
97 return NDR_ERR_SUCCESS
;
100 _PUBLIC_
void ndr_print_xattr_DosInfo2Old(struct ndr_print
*ndr
, const char *name
, const struct xattr_DosInfo2Old
*r
)
102 ndr_print_struct(ndr
, name
, "xattr_DosInfo2Old");
104 ndr_print_uint32(ndr
, "flags", r
->flags
);
105 ndr_print_uint32(ndr
, "attrib", r
->attrib
);
106 ndr_print_uint32(ndr
, "ea_size", r
->ea_size
);
107 ndr_print_udlong(ndr
, "size", r
->size
);
108 ndr_print_udlong(ndr
, "alloc_size", r
->alloc_size
);
109 ndr_print_NTTIME(ndr
, "create_time", r
->create_time
);
110 ndr_print_NTTIME(ndr
, "change_time", r
->change_time
);
111 ndr_print_NTTIME(ndr
, "write_time", r
->write_time
);
112 ndr_print_string(ndr
, "name", r
->name
);
116 static enum ndr_err_code
ndr_push_xattr_DosInfo(struct ndr_push
*ndr
, int ndr_flags
, const union xattr_DosInfo
*r
)
118 if (ndr_flags
& NDR_SCALARS
) {
119 int level
= ndr_push_get_switch_value(ndr
, r
);
120 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, level
));
123 NDR_CHECK(ndr_push_xattr_DosInfo1(ndr
, NDR_SCALARS
, &r
->info1
));
127 NDR_CHECK(ndr_push_xattr_DosInfo2Old(ndr
, NDR_SCALARS
, &r
->oldinfo2
));
131 return ndr_push_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
134 if (ndr_flags
& NDR_BUFFERS
) {
135 int level
= ndr_push_get_switch_value(ndr
, r
);
144 return ndr_push_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
147 return NDR_ERR_SUCCESS
;
150 static enum ndr_err_code
ndr_pull_xattr_DosInfo(struct ndr_pull
*ndr
, int ndr_flags
, union xattr_DosInfo
*r
)
154 level
= ndr_pull_get_switch_value(ndr
, r
);
155 if (ndr_flags
& NDR_SCALARS
) {
156 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &_level
));
157 if (_level
!= level
) {
158 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u for r", _level
);
162 NDR_CHECK(ndr_pull_xattr_DosInfo1(ndr
, NDR_SCALARS
, &r
->info1
));
166 NDR_CHECK(ndr_pull_xattr_DosInfo2Old(ndr
, NDR_SCALARS
, &r
->oldinfo2
));
170 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
173 if (ndr_flags
& NDR_BUFFERS
) {
182 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
185 return NDR_ERR_SUCCESS
;
188 _PUBLIC_
void ndr_print_xattr_DosInfo(struct ndr_print
*ndr
, const char *name
, const union xattr_DosInfo
*r
)
191 level
= ndr_print_get_switch_value(ndr
, r
);
192 ndr_print_union(ndr
, name
, level
, "xattr_DosInfo");
195 ndr_print_xattr_DosInfo1(ndr
, "info1", &r
->info1
);
199 ndr_print_xattr_DosInfo2Old(ndr
, "oldinfo2", &r
->oldinfo2
);
203 ndr_print_bad_level(ndr
, name
, level
);
207 _PUBLIC_
enum ndr_err_code
ndr_push_xattr_DosAttrib(struct ndr_push
*ndr
, int ndr_flags
, const struct xattr_DosAttrib
*r
)
209 if (ndr_flags
& NDR_SCALARS
) {
210 NDR_CHECK(ndr_push_align(ndr
, 4));
211 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->version
));
212 NDR_CHECK(ndr_push_set_switch_value(ndr
, &r
->info
, r
->version
));
213 NDR_CHECK(ndr_push_xattr_DosInfo(ndr
, NDR_SCALARS
, &r
->info
));
215 if (ndr_flags
& NDR_BUFFERS
) {
217 return NDR_ERR_SUCCESS
;
220 _PUBLIC_
enum ndr_err_code
ndr_pull_xattr_DosAttrib(struct ndr_pull
*ndr
, int ndr_flags
, struct xattr_DosAttrib
*r
)
222 if (ndr_flags
& NDR_SCALARS
) {
223 NDR_CHECK(ndr_pull_align(ndr
, 4));
224 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->version
));
225 NDR_CHECK(ndr_pull_set_switch_value(ndr
, &r
->info
, r
->version
));
226 NDR_CHECK(ndr_pull_xattr_DosInfo(ndr
, NDR_SCALARS
, &r
->info
));
228 if (ndr_flags
& NDR_BUFFERS
) {
230 return NDR_ERR_SUCCESS
;
233 _PUBLIC_
void ndr_print_xattr_DosAttrib(struct ndr_print
*ndr
, const char *name
, const struct xattr_DosAttrib
*r
)
235 ndr_print_struct(ndr
, name
, "xattr_DosAttrib");
237 ndr_print_uint16(ndr
, "version", r
->version
);
238 ndr_print_set_switch_value(ndr
, &r
->info
, r
->version
);
239 ndr_print_xattr_DosInfo(ndr
, "info", &r
->info
);
243 static enum ndr_err_code
ndr_push_xattr_EA(struct ndr_push
*ndr
, int ndr_flags
, const struct xattr_EA
*r
)
245 if (ndr_flags
& NDR_SCALARS
) {
246 NDR_CHECK(ndr_push_align(ndr
, 4));
248 uint32_t _flags_save_string
= ndr
->flags
;
249 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_STR_UTF8
|LIBNDR_FLAG_STR_NULLTERM
);
250 NDR_CHECK(ndr_push_string(ndr
, NDR_SCALARS
, r
->name
));
251 ndr
->flags
= _flags_save_string
;
253 NDR_CHECK(ndr_push_DATA_BLOB(ndr
, NDR_SCALARS
, r
->value
));
255 if (ndr_flags
& NDR_BUFFERS
) {
257 return NDR_ERR_SUCCESS
;
260 static enum ndr_err_code
ndr_pull_xattr_EA(struct ndr_pull
*ndr
, int ndr_flags
, struct xattr_EA
*r
)
262 if (ndr_flags
& NDR_SCALARS
) {
263 NDR_CHECK(ndr_pull_align(ndr
, 4));
265 uint32_t _flags_save_string
= ndr
->flags
;
266 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_STR_UTF8
|LIBNDR_FLAG_STR_NULLTERM
);
267 NDR_CHECK(ndr_pull_string(ndr
, NDR_SCALARS
, &r
->name
));
268 ndr
->flags
= _flags_save_string
;
270 NDR_CHECK(ndr_pull_DATA_BLOB(ndr
, NDR_SCALARS
, &r
->value
));
272 if (ndr_flags
& NDR_BUFFERS
) {
274 return NDR_ERR_SUCCESS
;
277 _PUBLIC_
void ndr_print_xattr_EA(struct ndr_print
*ndr
, const char *name
, const struct xattr_EA
*r
)
279 ndr_print_struct(ndr
, name
, "xattr_EA");
281 ndr_print_string(ndr
, "name", r
->name
);
282 ndr_print_DATA_BLOB(ndr
, "value", r
->value
);
286 _PUBLIC_
enum ndr_err_code
ndr_push_xattr_DosEAs(struct ndr_push
*ndr
, int ndr_flags
, const struct xattr_DosEAs
*r
)
289 if (ndr_flags
& NDR_SCALARS
) {
290 NDR_CHECK(ndr_push_align(ndr
, 4));
291 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->num_eas
));
292 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->eas
));
294 if (ndr_flags
& NDR_BUFFERS
) {
296 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->num_eas
));
297 for (cntr_eas_1
= 0; cntr_eas_1
< r
->num_eas
; cntr_eas_1
++) {
298 NDR_CHECK(ndr_push_xattr_EA(ndr
, NDR_SCALARS
, &r
->eas
[cntr_eas_1
]));
302 return NDR_ERR_SUCCESS
;
305 _PUBLIC_
enum ndr_err_code
ndr_pull_xattr_DosEAs(struct ndr_pull
*ndr
, int ndr_flags
, struct xattr_DosEAs
*r
)
309 TALLOC_CTX
*_mem_save_eas_0
;
310 TALLOC_CTX
*_mem_save_eas_1
;
311 if (ndr_flags
& NDR_SCALARS
) {
312 NDR_CHECK(ndr_pull_align(ndr
, 4));
313 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->num_eas
));
314 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_eas
));
316 NDR_PULL_ALLOC(ndr
, r
->eas
);
321 if (ndr_flags
& NDR_BUFFERS
) {
323 _mem_save_eas_0
= NDR_PULL_GET_MEM_CTX(ndr
);
324 NDR_PULL_SET_MEM_CTX(ndr
, r
->eas
, 0);
325 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->eas
));
326 NDR_PULL_ALLOC_N(ndr
, r
->eas
, ndr_get_array_size(ndr
, &r
->eas
));
327 _mem_save_eas_1
= NDR_PULL_GET_MEM_CTX(ndr
);
328 NDR_PULL_SET_MEM_CTX(ndr
, r
->eas
, 0);
329 for (cntr_eas_1
= 0; cntr_eas_1
< r
->num_eas
; cntr_eas_1
++) {
330 NDR_CHECK(ndr_pull_xattr_EA(ndr
, NDR_SCALARS
, &r
->eas
[cntr_eas_1
]));
332 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_eas_1
, 0);
333 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_eas_0
, 0);
336 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->eas
, r
->num_eas
));
339 return NDR_ERR_SUCCESS
;
342 _PUBLIC_
void ndr_print_xattr_DosEAs(struct ndr_print
*ndr
, const char *name
, const struct xattr_DosEAs
*r
)
345 ndr_print_struct(ndr
, name
, "xattr_DosEAs");
347 ndr_print_uint16(ndr
, "num_eas", r
->num_eas
);
348 ndr_print_ptr(ndr
, "eas", r
->eas
);
351 ndr
->print(ndr
, "%s: ARRAY(%d)", "eas", (int)r
->num_eas
);
353 for (cntr_eas_1
=0;cntr_eas_1
<r
->num_eas
;cntr_eas_1
++) {
355 if (asprintf(&idx_1
, "[%d]", cntr_eas_1
) != -1) {
356 ndr_print_xattr_EA(ndr
, "eas", &r
->eas
[cntr_eas_1
]);
366 _PUBLIC_
enum ndr_err_code
ndr_push_tdb_xattrs(struct ndr_push
*ndr
, int ndr_flags
, const struct tdb_xattrs
*r
)
369 if (ndr_flags
& NDR_SCALARS
) {
370 NDR_CHECK(ndr_push_align(ndr
, 4));
371 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->num_eas
));
372 for (cntr_eas_0
= 0; cntr_eas_0
< r
->num_eas
; cntr_eas_0
++) {
373 NDR_CHECK(ndr_push_xattr_EA(ndr
, NDR_SCALARS
, &r
->eas
[cntr_eas_0
]));
376 if (ndr_flags
& NDR_BUFFERS
) {
378 return NDR_ERR_SUCCESS
;
381 _PUBLIC_
enum ndr_err_code
ndr_pull_tdb_xattrs(struct ndr_pull
*ndr
, int ndr_flags
, struct tdb_xattrs
*r
)
384 TALLOC_CTX
*_mem_save_eas_0
;
385 if (ndr_flags
& NDR_SCALARS
) {
386 NDR_CHECK(ndr_pull_align(ndr
, 4));
387 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->num_eas
));
388 NDR_PULL_ALLOC_N(ndr
, r
->eas
, r
->num_eas
);
389 _mem_save_eas_0
= NDR_PULL_GET_MEM_CTX(ndr
);
390 NDR_PULL_SET_MEM_CTX(ndr
, r
->eas
, 0);
391 for (cntr_eas_0
= 0; cntr_eas_0
< r
->num_eas
; cntr_eas_0
++) {
392 NDR_CHECK(ndr_pull_xattr_EA(ndr
, NDR_SCALARS
, &r
->eas
[cntr_eas_0
]));
394 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_eas_0
, 0);
396 if (ndr_flags
& NDR_BUFFERS
) {
398 return NDR_ERR_SUCCESS
;
401 _PUBLIC_
void ndr_print_tdb_xattrs(struct ndr_print
*ndr
, const char *name
, const struct tdb_xattrs
*r
)
404 ndr_print_struct(ndr
, name
, "tdb_xattrs");
406 ndr_print_uint32(ndr
, "num_eas", r
->num_eas
);
407 ndr
->print(ndr
, "%s: ARRAY(%d)", "eas", (int)r
->num_eas
);
409 for (cntr_eas_0
=0;cntr_eas_0
<r
->num_eas
;cntr_eas_0
++) {
411 if (asprintf(&idx_0
, "[%d]", cntr_eas_0
) != -1) {
412 ndr_print_xattr_EA(ndr
, "eas", &r
->eas
[cntr_eas_0
]);
420 static enum ndr_err_code
ndr_push_xattr_DosStream(struct ndr_push
*ndr
, int ndr_flags
, const struct xattr_DosStream
*r
)
422 if (ndr_flags
& NDR_SCALARS
) {
423 NDR_CHECK(ndr_push_align(ndr
, 4));
424 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->flags
));
425 NDR_CHECK(ndr_push_udlong(ndr
, NDR_SCALARS
, r
->size
));
426 NDR_CHECK(ndr_push_udlong(ndr
, NDR_SCALARS
, r
->alloc_size
));
428 uint32_t _flags_save_string
= ndr
->flags
;
429 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_STR_UTF8
|LIBNDR_FLAG_STR_NULLTERM
);
430 NDR_CHECK(ndr_push_string(ndr
, NDR_SCALARS
, r
->name
));
431 ndr
->flags
= _flags_save_string
;
434 if (ndr_flags
& NDR_BUFFERS
) {
436 return NDR_ERR_SUCCESS
;
439 static enum ndr_err_code
ndr_pull_xattr_DosStream(struct ndr_pull
*ndr
, int ndr_flags
, struct xattr_DosStream
*r
)
441 if (ndr_flags
& NDR_SCALARS
) {
442 NDR_CHECK(ndr_pull_align(ndr
, 4));
443 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->flags
));
444 NDR_CHECK(ndr_pull_udlong(ndr
, NDR_SCALARS
, &r
->size
));
445 NDR_CHECK(ndr_pull_udlong(ndr
, NDR_SCALARS
, &r
->alloc_size
));
447 uint32_t _flags_save_string
= ndr
->flags
;
448 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_STR_UTF8
|LIBNDR_FLAG_STR_NULLTERM
);
449 NDR_CHECK(ndr_pull_string(ndr
, NDR_SCALARS
, &r
->name
));
450 ndr
->flags
= _flags_save_string
;
453 if (ndr_flags
& NDR_BUFFERS
) {
455 return NDR_ERR_SUCCESS
;
458 _PUBLIC_
void ndr_print_xattr_DosStream(struct ndr_print
*ndr
, const char *name
, const struct xattr_DosStream
*r
)
460 ndr_print_struct(ndr
, name
, "xattr_DosStream");
462 ndr_print_uint32(ndr
, "flags", r
->flags
);
463 ndr_print_udlong(ndr
, "size", r
->size
);
464 ndr_print_udlong(ndr
, "alloc_size", r
->alloc_size
);
465 ndr_print_string(ndr
, "name", r
->name
);
469 _PUBLIC_
enum ndr_err_code
ndr_push_xattr_DosStreams(struct ndr_push
*ndr
, int ndr_flags
, const struct xattr_DosStreams
*r
)
471 uint32_t cntr_streams_1
;
472 if (ndr_flags
& NDR_SCALARS
) {
473 NDR_CHECK(ndr_push_align(ndr
, 4));
474 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->num_streams
));
475 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->streams
));
477 if (ndr_flags
& NDR_BUFFERS
) {
479 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->num_streams
));
480 for (cntr_streams_1
= 0; cntr_streams_1
< r
->num_streams
; cntr_streams_1
++) {
481 NDR_CHECK(ndr_push_xattr_DosStream(ndr
, NDR_SCALARS
, &r
->streams
[cntr_streams_1
]));
485 return NDR_ERR_SUCCESS
;
488 _PUBLIC_
enum ndr_err_code
ndr_pull_xattr_DosStreams(struct ndr_pull
*ndr
, int ndr_flags
, struct xattr_DosStreams
*r
)
490 uint32_t _ptr_streams
;
491 uint32_t cntr_streams_1
;
492 TALLOC_CTX
*_mem_save_streams_0
;
493 TALLOC_CTX
*_mem_save_streams_1
;
494 if (ndr_flags
& NDR_SCALARS
) {
495 NDR_CHECK(ndr_pull_align(ndr
, 4));
496 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->num_streams
));
497 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_streams
));
499 NDR_PULL_ALLOC(ndr
, r
->streams
);
504 if (ndr_flags
& NDR_BUFFERS
) {
506 _mem_save_streams_0
= NDR_PULL_GET_MEM_CTX(ndr
);
507 NDR_PULL_SET_MEM_CTX(ndr
, r
->streams
, 0);
508 NDR_CHECK(ndr_pull_array_size(ndr
, &r
->streams
));
509 NDR_PULL_ALLOC_N(ndr
, r
->streams
, ndr_get_array_size(ndr
, &r
->streams
));
510 _mem_save_streams_1
= NDR_PULL_GET_MEM_CTX(ndr
);
511 NDR_PULL_SET_MEM_CTX(ndr
, r
->streams
, 0);
512 for (cntr_streams_1
= 0; cntr_streams_1
< r
->num_streams
; cntr_streams_1
++) {
513 NDR_CHECK(ndr_pull_xattr_DosStream(ndr
, NDR_SCALARS
, &r
->streams
[cntr_streams_1
]));
515 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_streams_1
, 0);
516 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_streams_0
, 0);
519 NDR_CHECK(ndr_check_array_size(ndr
, (void*)&r
->streams
, r
->num_streams
));
522 return NDR_ERR_SUCCESS
;
525 _PUBLIC_
void ndr_print_xattr_DosStreams(struct ndr_print
*ndr
, const char *name
, const struct xattr_DosStreams
*r
)
527 uint32_t cntr_streams_1
;
528 ndr_print_struct(ndr
, name
, "xattr_DosStreams");
530 ndr_print_uint32(ndr
, "num_streams", r
->num_streams
);
531 ndr_print_ptr(ndr
, "streams", r
->streams
);
534 ndr
->print(ndr
, "%s: ARRAY(%d)", "streams", (int)r
->num_streams
);
536 for (cntr_streams_1
=0;cntr_streams_1
<r
->num_streams
;cntr_streams_1
++) {
538 if (asprintf(&idx_1
, "[%d]", cntr_streams_1
) != -1) {
539 ndr_print_xattr_DosStream(ndr
, "streams", &r
->streams
[cntr_streams_1
]);
549 _PUBLIC_
enum ndr_err_code
ndr_push_security_descriptor_hash(struct ndr_push
*ndr
, int ndr_flags
, const struct security_descriptor_hash
*r
)
551 if (ndr_flags
& NDR_SCALARS
) {
552 NDR_CHECK(ndr_push_align(ndr
, 4));
553 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->sd
));
554 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->hash
, 16));
556 if (ndr_flags
& NDR_BUFFERS
) {
558 NDR_CHECK(ndr_push_security_descriptor(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sd
));
561 return NDR_ERR_SUCCESS
;
564 _PUBLIC_
enum ndr_err_code
ndr_pull_security_descriptor_hash(struct ndr_pull
*ndr
, int ndr_flags
, struct security_descriptor_hash
*r
)
567 TALLOC_CTX
*_mem_save_sd_0
;
568 if (ndr_flags
& NDR_SCALARS
) {
569 NDR_CHECK(ndr_pull_align(ndr
, 4));
570 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_sd
));
572 NDR_PULL_ALLOC(ndr
, r
->sd
);
576 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->hash
, 16));
578 if (ndr_flags
& NDR_BUFFERS
) {
580 _mem_save_sd_0
= NDR_PULL_GET_MEM_CTX(ndr
);
581 NDR_PULL_SET_MEM_CTX(ndr
, r
->sd
, 0);
582 NDR_CHECK(ndr_pull_security_descriptor(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sd
));
583 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sd_0
, 0);
586 return NDR_ERR_SUCCESS
;
589 _PUBLIC_
void ndr_print_security_descriptor_hash(struct ndr_print
*ndr
, const char *name
, const struct security_descriptor_hash
*r
)
591 ndr_print_struct(ndr
, name
, "security_descriptor_hash");
593 ndr_print_ptr(ndr
, "sd", r
->sd
);
596 ndr_print_security_descriptor(ndr
, "sd", r
->sd
);
599 ndr_print_array_uint8(ndr
, "hash", r
->hash
, 16);
603 static enum ndr_err_code
ndr_push_xattr_NTACL_Info(struct ndr_push
*ndr
, int ndr_flags
, const union xattr_NTACL_Info
*r
)
605 if (ndr_flags
& NDR_SCALARS
) {
606 int level
= ndr_push_get_switch_value(ndr
, r
);
607 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, level
));
610 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->sd
));
614 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->sd_hs
));
618 return ndr_push_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
621 if (ndr_flags
& NDR_BUFFERS
) {
622 int level
= ndr_push_get_switch_value(ndr
, r
);
626 NDR_CHECK(ndr_push_security_descriptor(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sd
));
632 NDR_CHECK(ndr_push_security_descriptor_hash(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sd_hs
));
637 return ndr_push_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
640 return NDR_ERR_SUCCESS
;
643 static enum ndr_err_code
ndr_pull_xattr_NTACL_Info(struct ndr_pull
*ndr
, int ndr_flags
, union xattr_NTACL_Info
*r
)
647 TALLOC_CTX
*_mem_save_sd_0
;
648 TALLOC_CTX
*_mem_save_sd_hs_0
;
649 level
= ndr_pull_get_switch_value(ndr
, r
);
650 if (ndr_flags
& NDR_SCALARS
) {
651 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &_level
));
652 if (_level
!= level
) {
653 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u for r", _level
);
658 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_sd
));
660 NDR_PULL_ALLOC(ndr
, r
->sd
);
668 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_sd_hs
));
670 NDR_PULL_ALLOC(ndr
, r
->sd_hs
);
677 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
680 if (ndr_flags
& NDR_BUFFERS
) {
684 _mem_save_sd_0
= NDR_PULL_GET_MEM_CTX(ndr
);
685 NDR_PULL_SET_MEM_CTX(ndr
, r
->sd
, 0);
686 NDR_CHECK(ndr_pull_security_descriptor(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sd
));
687 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sd_0
, 0);
693 _mem_save_sd_hs_0
= NDR_PULL_GET_MEM_CTX(ndr
);
694 NDR_PULL_SET_MEM_CTX(ndr
, r
->sd_hs
, 0);
695 NDR_CHECK(ndr_pull_security_descriptor_hash(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->sd_hs
));
696 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_sd_hs_0
, 0);
701 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
704 return NDR_ERR_SUCCESS
;
707 _PUBLIC_
void ndr_print_xattr_NTACL_Info(struct ndr_print
*ndr
, const char *name
, const union xattr_NTACL_Info
*r
)
710 level
= ndr_print_get_switch_value(ndr
, r
);
711 ndr_print_union(ndr
, name
, level
, "xattr_NTACL_Info");
714 ndr_print_ptr(ndr
, "sd", r
->sd
);
717 ndr_print_security_descriptor(ndr
, "sd", r
->sd
);
723 ndr_print_ptr(ndr
, "sd_hs", r
->sd_hs
);
726 ndr_print_security_descriptor_hash(ndr
, "sd_hs", r
->sd_hs
);
732 ndr_print_bad_level(ndr
, name
, level
);
736 _PUBLIC_
enum ndr_err_code
ndr_push_xattr_NTACL(struct ndr_push
*ndr
, int ndr_flags
, const struct xattr_NTACL
*r
)
738 if (ndr_flags
& NDR_SCALARS
) {
739 NDR_CHECK(ndr_push_align(ndr
, 4));
740 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->version
));
741 NDR_CHECK(ndr_push_set_switch_value(ndr
, &r
->info
, r
->version
));
742 NDR_CHECK(ndr_push_xattr_NTACL_Info(ndr
, NDR_SCALARS
, &r
->info
));
744 if (ndr_flags
& NDR_BUFFERS
) {
745 NDR_CHECK(ndr_push_xattr_NTACL_Info(ndr
, NDR_BUFFERS
, &r
->info
));
747 return NDR_ERR_SUCCESS
;
750 _PUBLIC_
enum ndr_err_code
ndr_pull_xattr_NTACL(struct ndr_pull
*ndr
, int ndr_flags
, struct xattr_NTACL
*r
)
752 if (ndr_flags
& NDR_SCALARS
) {
753 NDR_CHECK(ndr_pull_align(ndr
, 4));
754 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->version
));
755 NDR_CHECK(ndr_pull_set_switch_value(ndr
, &r
->info
, r
->version
));
756 NDR_CHECK(ndr_pull_xattr_NTACL_Info(ndr
, NDR_SCALARS
, &r
->info
));
758 if (ndr_flags
& NDR_BUFFERS
) {
759 NDR_CHECK(ndr_pull_xattr_NTACL_Info(ndr
, NDR_BUFFERS
, &r
->info
));
761 return NDR_ERR_SUCCESS
;
764 _PUBLIC_
void ndr_print_xattr_NTACL(struct ndr_print
*ndr
, const char *name
, const struct xattr_NTACL
*r
)
766 ndr_print_struct(ndr
, name
, "xattr_NTACL");
768 ndr_print_uint16(ndr
, "version", r
->version
);
769 ndr_print_set_switch_value(ndr
, &r
->info
, r
->version
);
770 ndr_print_xattr_NTACL_Info(ndr
, "info", &r
->info
);