Line data Source code
1 : /* parser auto-generated by pidl */
2 :
3 : #include "includes.h"
4 : #include "bin/default/librpc/gen_ndr/ndr_idmap.h"
5 :
6 : #include "librpc/gen_ndr/ndr_security.h"
7 9396 : _PUBLIC_ enum ndr_err_code ndr_push_id_type(struct ndr_push *ndr, ndr_flags_type ndr_flags, enum id_type r)
8 : {
9 9396 : NDR_CHECK(ndr_push_enum_uint1632(ndr, NDR_SCALARS, r));
10 9396 : return NDR_ERR_SUCCESS;
11 : }
12 :
13 9396 : _PUBLIC_ enum ndr_err_code ndr_pull_id_type(struct ndr_pull *ndr, ndr_flags_type ndr_flags, enum id_type *r)
14 : {
15 0 : uint16_t v;
16 9396 : NDR_CHECK(ndr_pull_enum_uint1632(ndr, NDR_SCALARS, &v));
17 9396 : *r = v;
18 9396 : return NDR_ERR_SUCCESS;
19 : }
20 :
21 0 : _PUBLIC_ void ndr_print_id_type(struct ndr_print *ndr, const char *name, enum id_type r)
22 : {
23 0 : const char *val = NULL;
24 :
25 0 : switch (r) {
26 0 : case ID_TYPE_NOT_SPECIFIED: val = "ID_TYPE_NOT_SPECIFIED"; break;
27 0 : case ID_TYPE_UID: val = "ID_TYPE_UID"; break;
28 0 : case ID_TYPE_GID: val = "ID_TYPE_GID"; break;
29 0 : case ID_TYPE_BOTH: val = "ID_TYPE_BOTH"; break;
30 0 : case ID_TYPE_WB_REQUIRE_TYPE: val = "ID_TYPE_WB_REQUIRE_TYPE"; break;
31 : }
32 0 : ndr_print_enum(ndr, name, "ENUM", val, r);
33 0 : }
34 :
35 5010 : _PUBLIC_ enum ndr_err_code ndr_push_unixid(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct unixid *r)
36 : {
37 5010 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
38 5010 : if (ndr_flags & NDR_SCALARS) {
39 5010 : NDR_CHECK(ndr_push_align(ndr, 4));
40 5010 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->id));
41 5010 : NDR_CHECK(ndr_push_id_type(ndr, NDR_SCALARS, r->type));
42 5010 : NDR_CHECK(ndr_push_trailer_align(ndr, 4));
43 : }
44 5010 : if (ndr_flags & NDR_BUFFERS) {
45 0 : }
46 5010 : return NDR_ERR_SUCCESS;
47 : }
48 :
49 5010 : _PUBLIC_ enum ndr_err_code ndr_pull_unixid(struct ndr_pull *ndr, ndr_flags_type ndr_flags, struct unixid *r)
50 : {
51 5010 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
52 5010 : if (ndr_flags & NDR_SCALARS) {
53 5010 : NDR_CHECK(ndr_pull_align(ndr, 4));
54 5010 : NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->id));
55 5010 : NDR_CHECK(ndr_pull_id_type(ndr, NDR_SCALARS, &r->type));
56 5010 : NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
57 : }
58 5010 : if (ndr_flags & NDR_BUFFERS) {
59 0 : }
60 5010 : return NDR_ERR_SUCCESS;
61 : }
62 :
63 0 : static void ndr_print_flags_unixid(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct unixid *r)
64 : {
65 0 : ndr_print_unixid(ndr, name, r);
66 0 : }
67 :
68 0 : _PUBLIC_ void ndr_print_unixid(struct ndr_print *ndr, const char *name, const struct unixid *r)
69 : {
70 0 : ndr_print_struct(ndr, name, "unixid");
71 0 : if (r == NULL) { ndr_print_null(ndr); return; }
72 0 : ndr->depth++;
73 0 : ndr_print_uint32(ndr, "id", r->id);
74 0 : ndr_print_id_type(ndr, "type", r->type);
75 0 : ndr->depth--;
76 : }
77 :
78 0 : _PUBLIC_ enum ndr_err_code ndr_push_id_mapping(struct ndr_push *ndr, ndr_flags_type ndr_flags, enum id_mapping r)
79 : {
80 0 : NDR_CHECK(ndr_push_enum_uint1632(ndr, NDR_SCALARS, r));
81 0 : return NDR_ERR_SUCCESS;
82 : }
83 :
84 0 : _PUBLIC_ enum ndr_err_code ndr_pull_id_mapping(struct ndr_pull *ndr, ndr_flags_type ndr_flags, enum id_mapping *r)
85 : {
86 0 : uint16_t v;
87 0 : NDR_CHECK(ndr_pull_enum_uint1632(ndr, NDR_SCALARS, &v));
88 0 : *r = v;
89 0 : return NDR_ERR_SUCCESS;
90 : }
91 :
92 0 : _PUBLIC_ void ndr_print_id_mapping(struct ndr_print *ndr, const char *name, enum id_mapping r)
93 : {
94 0 : const char *val = NULL;
95 :
96 0 : switch (r) {
97 0 : case ID_UNKNOWN: val = "ID_UNKNOWN"; break;
98 0 : case ID_MAPPED: val = "ID_MAPPED"; break;
99 0 : case ID_UNMAPPED: val = "ID_UNMAPPED"; break;
100 0 : case ID_EXPIRED: val = "ID_EXPIRED"; break;
101 0 : case ID_REQUIRE_TYPE: val = "ID_REQUIRE_TYPE"; break;
102 : }
103 0 : ndr_print_enum(ndr, name, "ENUM", val, r);
104 0 : }
105 :
106 0 : _PUBLIC_ enum ndr_err_code ndr_push_id_map(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct id_map *r)
107 : {
108 0 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
109 0 : if (ndr_flags & NDR_SCALARS) {
110 0 : NDR_CHECK(ndr_push_align(ndr, 5));
111 0 : NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid));
112 0 : NDR_CHECK(ndr_push_unixid(ndr, NDR_SCALARS, &r->xid));
113 0 : NDR_CHECK(ndr_push_id_mapping(ndr, NDR_SCALARS, r->status));
114 0 : NDR_CHECK(ndr_push_trailer_align(ndr, 5));
115 : }
116 0 : if (ndr_flags & NDR_BUFFERS) {
117 0 : if (r->sid) {
118 0 : NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->sid));
119 : }
120 : }
121 0 : return NDR_ERR_SUCCESS;
122 : }
123 :
124 0 : _PUBLIC_ enum ndr_err_code ndr_pull_id_map(struct ndr_pull *ndr, ndr_flags_type ndr_flags, struct id_map *r)
125 : {
126 0 : uint32_t _ptr_sid;
127 0 : TALLOC_CTX *_mem_save_sid_0 = NULL;
128 0 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
129 0 : if (ndr_flags & NDR_SCALARS) {
130 0 : NDR_CHECK(ndr_pull_align(ndr, 5));
131 0 : NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid));
132 0 : if (_ptr_sid) {
133 0 : NDR_PULL_ALLOC(ndr, r->sid);
134 : } else {
135 0 : r->sid = NULL;
136 : }
137 0 : NDR_CHECK(ndr_pull_unixid(ndr, NDR_SCALARS, &r->xid));
138 0 : NDR_CHECK(ndr_pull_id_mapping(ndr, NDR_SCALARS, &r->status));
139 0 : NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
140 : }
141 0 : if (ndr_flags & NDR_BUFFERS) {
142 0 : if (r->sid) {
143 0 : _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
144 0 : NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0);
145 0 : NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->sid));
146 0 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0);
147 : }
148 : }
149 0 : return NDR_ERR_SUCCESS;
150 : }
151 :
152 0 : static void ndr_print_flags_id_map(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct id_map *r)
153 : {
154 0 : ndr_print_id_map(ndr, name, r);
155 0 : }
156 :
157 0 : _PUBLIC_ void ndr_print_id_map(struct ndr_print *ndr, const char *name, const struct id_map *r)
158 : {
159 0 : ndr_print_struct(ndr, name, "id_map");
160 0 : if (r == NULL) { ndr_print_null(ndr); return; }
161 0 : ndr->depth++;
162 0 : ndr_print_ptr(ndr, "sid", r->sid);
163 0 : ndr->depth++;
164 0 : if (r->sid) {
165 0 : ndr_print_dom_sid(ndr, "sid", r->sid);
166 : }
167 0 : ndr->depth--;
168 0 : ndr_print_unixid(ndr, "xid", &r->xid);
169 0 : ndr_print_id_mapping(ndr, "status", r->status);
170 0 : ndr->depth--;
171 : }
172 :
173 : #ifndef SKIP_NDR_TABLE_idmap
174 : static const struct ndr_interface_public_struct idmap_public_structs[] = {
175 : {
176 : .name = "unixid",
177 : .struct_size = sizeof(struct unixid ),
178 : .ndr_push = (ndr_push_flags_fn_t) ndr_push_unixid,
179 : .ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_unixid,
180 : .ndr_print = (ndr_print_function_t) ndr_print_flags_unixid,
181 : },
182 : {
183 : .name = "id_map",
184 : .struct_size = sizeof(struct id_map ),
185 : .ndr_push = (ndr_push_flags_fn_t) ndr_push_id_map,
186 : .ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_id_map,
187 : .ndr_print = (ndr_print_function_t) ndr_print_flags_id_map,
188 : },
189 : { .name = NULL }
190 : };
191 :
192 : static const struct ndr_interface_call idmap_calls[] = {
193 : { .name = NULL }
194 : };
195 :
196 : static const char * const idmap_endpoint_strings[] = {
197 : "ncacn_np:[\\pipe\\idmap]",
198 : };
199 :
200 : static const struct ndr_interface_string_array idmap_endpoints = {
201 : .count = 1,
202 : .names = idmap_endpoint_strings
203 : };
204 :
205 : static const char * const idmap_authservice_strings[] = {
206 : "host",
207 : };
208 :
209 : static const struct ndr_interface_string_array idmap_authservices = {
210 : .count = 1,
211 : .names = idmap_authservice_strings
212 : };
213 :
214 :
215 : const struct ndr_interface_table ndr_table_idmap = {
216 : .name = "idmap",
217 : .num_calls = 0,
218 : .calls = idmap_calls,
219 : .num_public_structs = 2,
220 : .public_structs = idmap_public_structs,
221 : .endpoints = &idmap_endpoints,
222 : .authservices = &idmap_authservices
223 : };
224 :
225 : #endif /* SKIP_NDR_TABLE_idmap */
|