Add my copyright.
[Samba.git] / source / librpc / gen_ndr / srv_unixinfo.c
blob6142bb113f63bf81726d4544222dbd65d6a7228c
1 /*
2 * Unix SMB/CIFS implementation.
3 * server auto-generated by pidl. DO NOT MODIFY!
4 */
6 #include "includes.h"
7 #include "librpc/gen_ndr/srv_unixinfo.h"
9 static bool api_unixinfo_SidToUid(pipes_struct *p)
11 const struct ndr_interface_call *call;
12 struct ndr_pull *pull;
13 struct ndr_push *push;
14 enum ndr_err_code ndr_err;
15 DATA_BLOB blob;
16 struct unixinfo_SidToUid *r;
18 call = &ndr_table_unixinfo.calls[NDR_UNIXINFO_SIDTOUID];
20 r = talloc(talloc_tos(), struct unixinfo_SidToUid);
21 if (r == NULL) {
22 return false;
25 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
26 talloc_free(r);
27 return false;
30 pull = ndr_pull_init_blob(&blob, r);
31 if (pull == NULL) {
32 talloc_free(r);
33 return false;
36 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
37 ndr_err = call->ndr_pull(pull, NDR_IN, r);
38 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
39 talloc_free(r);
40 return false;
43 if (DEBUGLEVEL >= 10) {
44 NDR_PRINT_IN_DEBUG(unixinfo_SidToUid, r);
47 ZERO_STRUCT(r->out);
48 r->out.uid = talloc_zero(r, uint64_t);
49 if (r->out.uid == NULL) {
50 talloc_free(r);
51 return false;
54 r->out.result = _unixinfo_SidToUid(p, r);
56 if (p->rng_fault_state) {
57 talloc_free(r);
58 /* Return true here, srv_pipe_hnd.c will take care */
59 return true;
62 if (DEBUGLEVEL >= 10) {
63 NDR_PRINT_OUT_DEBUG(unixinfo_SidToUid, r);
66 push = ndr_push_init_ctx(r);
67 if (push == NULL) {
68 talloc_free(r);
69 return false;
72 ndr_err = call->ndr_push(push, NDR_OUT, r);
73 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
74 talloc_free(r);
75 return false;
78 blob = ndr_push_blob(push);
79 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
80 talloc_free(r);
81 return false;
84 talloc_free(r);
86 return true;
89 static bool api_unixinfo_UidToSid(pipes_struct *p)
91 const struct ndr_interface_call *call;
92 struct ndr_pull *pull;
93 struct ndr_push *push;
94 enum ndr_err_code ndr_err;
95 DATA_BLOB blob;
96 struct unixinfo_UidToSid *r;
98 call = &ndr_table_unixinfo.calls[NDR_UNIXINFO_UIDTOSID];
100 r = talloc(talloc_tos(), struct unixinfo_UidToSid);
101 if (r == NULL) {
102 return false;
105 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
106 talloc_free(r);
107 return false;
110 pull = ndr_pull_init_blob(&blob, r);
111 if (pull == NULL) {
112 talloc_free(r);
113 return false;
116 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
117 ndr_err = call->ndr_pull(pull, NDR_IN, r);
118 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
119 talloc_free(r);
120 return false;
123 if (DEBUGLEVEL >= 10) {
124 NDR_PRINT_IN_DEBUG(unixinfo_UidToSid, r);
127 ZERO_STRUCT(r->out);
128 r->out.sid = talloc_zero(r, struct dom_sid);
129 if (r->out.sid == NULL) {
130 talloc_free(r);
131 return false;
134 r->out.result = _unixinfo_UidToSid(p, r);
136 if (p->rng_fault_state) {
137 talloc_free(r);
138 /* Return true here, srv_pipe_hnd.c will take care */
139 return true;
142 if (DEBUGLEVEL >= 10) {
143 NDR_PRINT_OUT_DEBUG(unixinfo_UidToSid, r);
146 push = ndr_push_init_ctx(r);
147 if (push == NULL) {
148 talloc_free(r);
149 return false;
152 ndr_err = call->ndr_push(push, NDR_OUT, r);
153 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
154 talloc_free(r);
155 return false;
158 blob = ndr_push_blob(push);
159 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
160 talloc_free(r);
161 return false;
164 talloc_free(r);
166 return true;
169 static bool api_unixinfo_SidToGid(pipes_struct *p)
171 const struct ndr_interface_call *call;
172 struct ndr_pull *pull;
173 struct ndr_push *push;
174 enum ndr_err_code ndr_err;
175 DATA_BLOB blob;
176 struct unixinfo_SidToGid *r;
178 call = &ndr_table_unixinfo.calls[NDR_UNIXINFO_SIDTOGID];
180 r = talloc(talloc_tos(), struct unixinfo_SidToGid);
181 if (r == NULL) {
182 return false;
185 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
186 talloc_free(r);
187 return false;
190 pull = ndr_pull_init_blob(&blob, r);
191 if (pull == NULL) {
192 talloc_free(r);
193 return false;
196 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
197 ndr_err = call->ndr_pull(pull, NDR_IN, r);
198 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
199 talloc_free(r);
200 return false;
203 if (DEBUGLEVEL >= 10) {
204 NDR_PRINT_IN_DEBUG(unixinfo_SidToGid, r);
207 ZERO_STRUCT(r->out);
208 r->out.gid = talloc_zero(r, uint64_t);
209 if (r->out.gid == NULL) {
210 talloc_free(r);
211 return false;
214 r->out.result = _unixinfo_SidToGid(p, r);
216 if (p->rng_fault_state) {
217 talloc_free(r);
218 /* Return true here, srv_pipe_hnd.c will take care */
219 return true;
222 if (DEBUGLEVEL >= 10) {
223 NDR_PRINT_OUT_DEBUG(unixinfo_SidToGid, r);
226 push = ndr_push_init_ctx(r);
227 if (push == NULL) {
228 talloc_free(r);
229 return false;
232 ndr_err = call->ndr_push(push, NDR_OUT, r);
233 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
234 talloc_free(r);
235 return false;
238 blob = ndr_push_blob(push);
239 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
240 talloc_free(r);
241 return false;
244 talloc_free(r);
246 return true;
249 static bool api_unixinfo_GidToSid(pipes_struct *p)
251 const struct ndr_interface_call *call;
252 struct ndr_pull *pull;
253 struct ndr_push *push;
254 enum ndr_err_code ndr_err;
255 DATA_BLOB blob;
256 struct unixinfo_GidToSid *r;
258 call = &ndr_table_unixinfo.calls[NDR_UNIXINFO_GIDTOSID];
260 r = talloc(talloc_tos(), struct unixinfo_GidToSid);
261 if (r == NULL) {
262 return false;
265 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
266 talloc_free(r);
267 return false;
270 pull = ndr_pull_init_blob(&blob, r);
271 if (pull == NULL) {
272 talloc_free(r);
273 return false;
276 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
277 ndr_err = call->ndr_pull(pull, NDR_IN, r);
278 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
279 talloc_free(r);
280 return false;
283 if (DEBUGLEVEL >= 10) {
284 NDR_PRINT_IN_DEBUG(unixinfo_GidToSid, r);
287 ZERO_STRUCT(r->out);
288 r->out.sid = talloc_zero(r, struct dom_sid);
289 if (r->out.sid == NULL) {
290 talloc_free(r);
291 return false;
294 r->out.result = _unixinfo_GidToSid(p, r);
296 if (p->rng_fault_state) {
297 talloc_free(r);
298 /* Return true here, srv_pipe_hnd.c will take care */
299 return true;
302 if (DEBUGLEVEL >= 10) {
303 NDR_PRINT_OUT_DEBUG(unixinfo_GidToSid, r);
306 push = ndr_push_init_ctx(r);
307 if (push == NULL) {
308 talloc_free(r);
309 return false;
312 ndr_err = call->ndr_push(push, NDR_OUT, r);
313 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
314 talloc_free(r);
315 return false;
318 blob = ndr_push_blob(push);
319 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
320 talloc_free(r);
321 return false;
324 talloc_free(r);
326 return true;
329 static bool api_unixinfo_GetPWUid(pipes_struct *p)
331 const struct ndr_interface_call *call;
332 struct ndr_pull *pull;
333 struct ndr_push *push;
334 enum ndr_err_code ndr_err;
335 DATA_BLOB blob;
336 struct unixinfo_GetPWUid *r;
338 call = &ndr_table_unixinfo.calls[NDR_UNIXINFO_GETPWUID];
340 r = talloc(talloc_tos(), struct unixinfo_GetPWUid);
341 if (r == NULL) {
342 return false;
345 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
346 talloc_free(r);
347 return false;
350 pull = ndr_pull_init_blob(&blob, r);
351 if (pull == NULL) {
352 talloc_free(r);
353 return false;
356 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
357 ndr_err = call->ndr_pull(pull, NDR_IN, r);
358 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
359 talloc_free(r);
360 return false;
363 if (DEBUGLEVEL >= 10) {
364 NDR_PRINT_IN_DEBUG(unixinfo_GetPWUid, r);
367 ZERO_STRUCT(r->out);
368 r->out.count = r->in.count;
369 r->out.infos = talloc_zero_array(r, struct unixinfo_GetPWUidInfo, *r->out.count);
370 if (r->out.infos == NULL) {
371 talloc_free(r);
372 return false;
375 r->out.result = _unixinfo_GetPWUid(p, r);
377 if (p->rng_fault_state) {
378 talloc_free(r);
379 /* Return true here, srv_pipe_hnd.c will take care */
380 return true;
383 if (DEBUGLEVEL >= 10) {
384 NDR_PRINT_OUT_DEBUG(unixinfo_GetPWUid, r);
387 push = ndr_push_init_ctx(r);
388 if (push == NULL) {
389 talloc_free(r);
390 return false;
393 ndr_err = call->ndr_push(push, NDR_OUT, r);
394 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
395 talloc_free(r);
396 return false;
399 blob = ndr_push_blob(push);
400 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
401 talloc_free(r);
402 return false;
405 talloc_free(r);
407 return true;
411 /* Tables */
412 static struct api_struct api_unixinfo_cmds[] =
414 {"UNIXINFO_SIDTOUID", NDR_UNIXINFO_SIDTOUID, api_unixinfo_SidToUid},
415 {"UNIXINFO_UIDTOSID", NDR_UNIXINFO_UIDTOSID, api_unixinfo_UidToSid},
416 {"UNIXINFO_SIDTOGID", NDR_UNIXINFO_SIDTOGID, api_unixinfo_SidToGid},
417 {"UNIXINFO_GIDTOSID", NDR_UNIXINFO_GIDTOSID, api_unixinfo_GidToSid},
418 {"UNIXINFO_GETPWUID", NDR_UNIXINFO_GETPWUID, api_unixinfo_GetPWUid},
421 void unixinfo_get_pipe_fns(struct api_struct **fns, int *n_fns)
423 *fns = api_unixinfo_cmds;
424 *n_fns = sizeof(api_unixinfo_cmds) / sizeof(struct api_struct);
427 NTSTATUS rpc_unixinfo_init(void)
429 return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "unixinfo", "unixinfo", api_unixinfo_cmds, sizeof(api_unixinfo_cmds) / sizeof(struct api_struct));