s3: add secrets.idl.
[ira/wip.git] / source3 / librpc / gen_ndr / ndr_secrets.c
1 /* parser auto-generated by pidl */
2
3 #include "includes.h"
4 #include "librpc/gen_ndr/ndr_secrets.h"
5
6 _PUBLIC_ enum ndr_err_code ndr_push_TRUSTED_DOM_PASS(struct ndr_push *ndr, int ndr_flags, const struct TRUSTED_DOM_PASS *r)
7 {
8         {
9                 uint32_t _flags_save_STRUCT = ndr->flags;
10                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
11                 if (ndr_flags & NDR_SCALARS) {
12                         NDR_CHECK(ndr_push_align(ndr, 4));
13                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m_term(r->uni_name)));
14                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->uni_name, 32, sizeof(uint16_t), CH_UTF16));
15                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen(r->pass)));
16                         {
17                                 uint32_t _flags_save_string = ndr->flags;
18                                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
19                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->pass));
20                                 ndr->flags = _flags_save_string;
21                         }
22                         NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->mod_time));
23                         NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, &r->domain_sid));
24                         NDR_CHECK(ndr_push_trailer_align(ndr, 4));
25                 }
26                 if (ndr_flags & NDR_BUFFERS) {
27                         NDR_CHECK(ndr_push_dom_sid(ndr, NDR_BUFFERS, &r->domain_sid));
28                 }
29                 ndr->flags = _flags_save_STRUCT;
30         }
31         return NDR_ERR_SUCCESS;
32 }
33
34 _PUBLIC_ enum ndr_err_code ndr_pull_TRUSTED_DOM_PASS(struct ndr_pull *ndr, int ndr_flags, struct TRUSTED_DOM_PASS *r)
35 {
36         {
37                 uint32_t _flags_save_STRUCT = ndr->flags;
38                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
39                 if (ndr_flags & NDR_SCALARS) {
40                         NDR_CHECK(ndr_pull_align(ndr, 4));
41                         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->uni_name_len));
42                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->uni_name, 32, sizeof(uint16_t), CH_UTF16));
43                         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pass_len));
44                         {
45                                 uint32_t _flags_save_string = ndr->flags;
46                                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
47                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->pass));
48                                 ndr->flags = _flags_save_string;
49                         }
50                         NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->mod_time));
51                         NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, &r->domain_sid));
52                         NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
53                 }
54                 if (ndr_flags & NDR_BUFFERS) {
55                         NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_BUFFERS, &r->domain_sid));
56                 }
57                 ndr->flags = _flags_save_STRUCT;
58         }
59         return NDR_ERR_SUCCESS;
60 }
61
62 _PUBLIC_ void ndr_print_TRUSTED_DOM_PASS(struct ndr_print *ndr, const char *name, const struct TRUSTED_DOM_PASS *r)
63 {
64         ndr_print_struct(ndr, name, "TRUSTED_DOM_PASS");
65         {
66                 uint32_t _flags_save_STRUCT = ndr->flags;
67                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
68                 ndr->depth++;
69                 ndr_print_uint32(ndr, "uni_name_len", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m_term(r->uni_name):r->uni_name_len);
70                 ndr_print_string(ndr, "uni_name", r->uni_name);
71                 ndr_print_uint32(ndr, "pass_len", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen(r->pass):r->pass_len);
72                 ndr_print_string(ndr, "pass", r->pass);
73                 ndr_print_time_t(ndr, "mod_time", r->mod_time);
74                 ndr_print_dom_sid(ndr, "domain_sid", &r->domain_sid);
75                 ndr->depth--;
76                 ndr->flags = _flags_save_STRUCT;
77         }
78 }
79