librpc/gen_ndr
[metze/samba/wip.git] / source3 / librpc / gen_ndr / cli_unixinfo.c
1 /*
2  * Unix SMB/CIFS implementation.
3  * client auto-generated by pidl. DO NOT MODIFY!
4  */
5
6 #include "includes.h"
7 #include "librpc/gen_ndr/cli_unixinfo.h"
8
9 struct rpccli_unixinfo_SidToUid_state {
10         TALLOC_CTX *out_mem_ctx;
11         NTSTATUS result;
12 };
13
14 static void rpccli_unixinfo_SidToUid_done(struct tevent_req *subreq);
15
16 struct tevent_req *rpccli_unixinfo_SidToUid_send(TALLOC_CTX *mem_ctx,
17                                                  struct tevent_context *ev,
18                                                  struct rpc_pipe_client *cli,
19                                                  struct dom_sid _sid /* [in]  */,
20                                                  uint64_t *_uid /* [out] [ref] */)
21 {
22         struct tevent_req *req;
23         struct rpccli_unixinfo_SidToUid_state *state;
24         struct tevent_req *subreq;
25
26         req = tevent_req_create(mem_ctx, &state,
27                                 struct rpccli_unixinfo_SidToUid_state);
28         if (req == NULL) {
29                 return NULL;
30         }
31         state->out_mem_ctx = NULL;
32
33         state->out_mem_ctx = talloc_named_const(state, 0,
34                              "rpccli_unixinfo_SidToUid_out_memory");
35         if (tevent_req_nomem(state->out_mem_ctx, req)) {
36                 return tevent_req_post(req, ev);
37         }
38
39         subreq = dcerpc_unixinfo_SidToUid_send(state,
40                                                ev,
41                                                cli->binding_handle,
42                                                _sid,
43                                                _uid);
44         if (tevent_req_nomem(subreq, req)) {
45                 return tevent_req_post(req, ev);
46         }
47         tevent_req_set_callback(subreq, rpccli_unixinfo_SidToUid_done, req);
48         return req;
49 }
50
51 static void rpccli_unixinfo_SidToUid_done(struct tevent_req *subreq)
52 {
53         struct tevent_req *req = tevent_req_callback_data(
54                 subreq, struct tevent_req);
55         struct rpccli_unixinfo_SidToUid_state *state = tevent_req_data(
56                 req, struct rpccli_unixinfo_SidToUid_state);
57         NTSTATUS status;
58         TALLOC_CTX *mem_ctx;
59
60         if (state->out_mem_ctx) {
61                 mem_ctx = state->out_mem_ctx;
62         } else {
63                 mem_ctx = state;
64         }
65
66         status = dcerpc_unixinfo_SidToUid_recv(subreq,
67                                                mem_ctx,
68                                                &state->result);
69         TALLOC_FREE(subreq);
70         if (!NT_STATUS_IS_OK(status)) {
71                 tevent_req_nterror(req, status);
72                 return;
73         }
74
75         tevent_req_done(req);
76 }
77
78 NTSTATUS rpccli_unixinfo_SidToUid_recv(struct tevent_req *req,
79                                        TALLOC_CTX *mem_ctx,
80                                        NTSTATUS *result)
81 {
82         struct rpccli_unixinfo_SidToUid_state *state = tevent_req_data(
83                 req, struct rpccli_unixinfo_SidToUid_state);
84         NTSTATUS status;
85
86         if (tevent_req_is_nterror(req, &status)) {
87                 tevent_req_received(req);
88                 return status;
89         }
90
91         /* Steal possible out parameters to the callers context */
92         talloc_steal(mem_ctx, state->out_mem_ctx);
93
94         /* Return result */
95         *result = state->result;
96
97         tevent_req_received(req);
98         return NT_STATUS_OK;
99 }
100
101 NTSTATUS rpccli_unixinfo_SidToUid(struct rpc_pipe_client *cli,
102                                   TALLOC_CTX *mem_ctx,
103                                   struct dom_sid _sid /* [in]  */,
104                                   uint64_t *_uid /* [out] [ref] */)
105 {
106         NTSTATUS result;
107         NTSTATUS status;
108
109         status = dcerpc_unixinfo_SidToUid(cli->binding_handle,
110                                           mem_ctx,
111                                           _sid,
112                                           _uid,
113                                           &result);
114         if (!NT_STATUS_IS_OK(status)) {
115                 return status;
116         }
117
118         /* Return result */
119         return result;
120 }
121
122 struct rpccli_unixinfo_UidToSid_state {
123         TALLOC_CTX *out_mem_ctx;
124         NTSTATUS result;
125 };
126
127 static void rpccli_unixinfo_UidToSid_done(struct tevent_req *subreq);
128
129 struct tevent_req *rpccli_unixinfo_UidToSid_send(TALLOC_CTX *mem_ctx,
130                                                  struct tevent_context *ev,
131                                                  struct rpc_pipe_client *cli,
132                                                  uint64_t _uid /* [in]  */,
133                                                  struct dom_sid *_sid /* [out] [ref] */)
134 {
135         struct tevent_req *req;
136         struct rpccli_unixinfo_UidToSid_state *state;
137         struct tevent_req *subreq;
138
139         req = tevent_req_create(mem_ctx, &state,
140                                 struct rpccli_unixinfo_UidToSid_state);
141         if (req == NULL) {
142                 return NULL;
143         }
144         state->out_mem_ctx = NULL;
145
146         state->out_mem_ctx = talloc_named_const(state, 0,
147                              "rpccli_unixinfo_UidToSid_out_memory");
148         if (tevent_req_nomem(state->out_mem_ctx, req)) {
149                 return tevent_req_post(req, ev);
150         }
151
152         subreq = dcerpc_unixinfo_UidToSid_send(state,
153                                                ev,
154                                                cli->binding_handle,
155                                                _uid,
156                                                _sid);
157         if (tevent_req_nomem(subreq, req)) {
158                 return tevent_req_post(req, ev);
159         }
160         tevent_req_set_callback(subreq, rpccli_unixinfo_UidToSid_done, req);
161         return req;
162 }
163
164 static void rpccli_unixinfo_UidToSid_done(struct tevent_req *subreq)
165 {
166         struct tevent_req *req = tevent_req_callback_data(
167                 subreq, struct tevent_req);
168         struct rpccli_unixinfo_UidToSid_state *state = tevent_req_data(
169                 req, struct rpccli_unixinfo_UidToSid_state);
170         NTSTATUS status;
171         TALLOC_CTX *mem_ctx;
172
173         if (state->out_mem_ctx) {
174                 mem_ctx = state->out_mem_ctx;
175         } else {
176                 mem_ctx = state;
177         }
178
179         status = dcerpc_unixinfo_UidToSid_recv(subreq,
180                                                mem_ctx,
181                                                &state->result);
182         TALLOC_FREE(subreq);
183         if (!NT_STATUS_IS_OK(status)) {
184                 tevent_req_nterror(req, status);
185                 return;
186         }
187
188         tevent_req_done(req);
189 }
190
191 NTSTATUS rpccli_unixinfo_UidToSid_recv(struct tevent_req *req,
192                                        TALLOC_CTX *mem_ctx,
193                                        NTSTATUS *result)
194 {
195         struct rpccli_unixinfo_UidToSid_state *state = tevent_req_data(
196                 req, struct rpccli_unixinfo_UidToSid_state);
197         NTSTATUS status;
198
199         if (tevent_req_is_nterror(req, &status)) {
200                 tevent_req_received(req);
201                 return status;
202         }
203
204         /* Steal possible out parameters to the callers context */
205         talloc_steal(mem_ctx, state->out_mem_ctx);
206
207         /* Return result */
208         *result = state->result;
209
210         tevent_req_received(req);
211         return NT_STATUS_OK;
212 }
213
214 NTSTATUS rpccli_unixinfo_UidToSid(struct rpc_pipe_client *cli,
215                                   TALLOC_CTX *mem_ctx,
216                                   uint64_t _uid /* [in]  */,
217                                   struct dom_sid *_sid /* [out] [ref] */)
218 {
219         NTSTATUS result;
220         NTSTATUS status;
221
222         status = dcerpc_unixinfo_UidToSid(cli->binding_handle,
223                                           mem_ctx,
224                                           _uid,
225                                           _sid,
226                                           &result);
227         if (!NT_STATUS_IS_OK(status)) {
228                 return status;
229         }
230
231         /* Return result */
232         return result;
233 }
234
235 struct rpccli_unixinfo_SidToGid_state {
236         TALLOC_CTX *out_mem_ctx;
237         NTSTATUS result;
238 };
239
240 static void rpccli_unixinfo_SidToGid_done(struct tevent_req *subreq);
241
242 struct tevent_req *rpccli_unixinfo_SidToGid_send(TALLOC_CTX *mem_ctx,
243                                                  struct tevent_context *ev,
244                                                  struct rpc_pipe_client *cli,
245                                                  struct dom_sid _sid /* [in]  */,
246                                                  uint64_t *_gid /* [out] [ref] */)
247 {
248         struct tevent_req *req;
249         struct rpccli_unixinfo_SidToGid_state *state;
250         struct tevent_req *subreq;
251
252         req = tevent_req_create(mem_ctx, &state,
253                                 struct rpccli_unixinfo_SidToGid_state);
254         if (req == NULL) {
255                 return NULL;
256         }
257         state->out_mem_ctx = NULL;
258
259         state->out_mem_ctx = talloc_named_const(state, 0,
260                              "rpccli_unixinfo_SidToGid_out_memory");
261         if (tevent_req_nomem(state->out_mem_ctx, req)) {
262                 return tevent_req_post(req, ev);
263         }
264
265         subreq = dcerpc_unixinfo_SidToGid_send(state,
266                                                ev,
267                                                cli->binding_handle,
268                                                _sid,
269                                                _gid);
270         if (tevent_req_nomem(subreq, req)) {
271                 return tevent_req_post(req, ev);
272         }
273         tevent_req_set_callback(subreq, rpccli_unixinfo_SidToGid_done, req);
274         return req;
275 }
276
277 static void rpccli_unixinfo_SidToGid_done(struct tevent_req *subreq)
278 {
279         struct tevent_req *req = tevent_req_callback_data(
280                 subreq, struct tevent_req);
281         struct rpccli_unixinfo_SidToGid_state *state = tevent_req_data(
282                 req, struct rpccli_unixinfo_SidToGid_state);
283         NTSTATUS status;
284         TALLOC_CTX *mem_ctx;
285
286         if (state->out_mem_ctx) {
287                 mem_ctx = state->out_mem_ctx;
288         } else {
289                 mem_ctx = state;
290         }
291
292         status = dcerpc_unixinfo_SidToGid_recv(subreq,
293                                                mem_ctx,
294                                                &state->result);
295         TALLOC_FREE(subreq);
296         if (!NT_STATUS_IS_OK(status)) {
297                 tevent_req_nterror(req, status);
298                 return;
299         }
300
301         tevent_req_done(req);
302 }
303
304 NTSTATUS rpccli_unixinfo_SidToGid_recv(struct tevent_req *req,
305                                        TALLOC_CTX *mem_ctx,
306                                        NTSTATUS *result)
307 {
308         struct rpccli_unixinfo_SidToGid_state *state = tevent_req_data(
309                 req, struct rpccli_unixinfo_SidToGid_state);
310         NTSTATUS status;
311
312         if (tevent_req_is_nterror(req, &status)) {
313                 tevent_req_received(req);
314                 return status;
315         }
316
317         /* Steal possible out parameters to the callers context */
318         talloc_steal(mem_ctx, state->out_mem_ctx);
319
320         /* Return result */
321         *result = state->result;
322
323         tevent_req_received(req);
324         return NT_STATUS_OK;
325 }
326
327 NTSTATUS rpccli_unixinfo_SidToGid(struct rpc_pipe_client *cli,
328                                   TALLOC_CTX *mem_ctx,
329                                   struct dom_sid _sid /* [in]  */,
330                                   uint64_t *_gid /* [out] [ref] */)
331 {
332         NTSTATUS result;
333         NTSTATUS status;
334
335         status = dcerpc_unixinfo_SidToGid(cli->binding_handle,
336                                           mem_ctx,
337                                           _sid,
338                                           _gid,
339                                           &result);
340         if (!NT_STATUS_IS_OK(status)) {
341                 return status;
342         }
343
344         /* Return result */
345         return result;
346 }
347
348 struct rpccli_unixinfo_GidToSid_state {
349         TALLOC_CTX *out_mem_ctx;
350         NTSTATUS result;
351 };
352
353 static void rpccli_unixinfo_GidToSid_done(struct tevent_req *subreq);
354
355 struct tevent_req *rpccli_unixinfo_GidToSid_send(TALLOC_CTX *mem_ctx,
356                                                  struct tevent_context *ev,
357                                                  struct rpc_pipe_client *cli,
358                                                  uint64_t _gid /* [in]  */,
359                                                  struct dom_sid *_sid /* [out] [ref] */)
360 {
361         struct tevent_req *req;
362         struct rpccli_unixinfo_GidToSid_state *state;
363         struct tevent_req *subreq;
364
365         req = tevent_req_create(mem_ctx, &state,
366                                 struct rpccli_unixinfo_GidToSid_state);
367         if (req == NULL) {
368                 return NULL;
369         }
370         state->out_mem_ctx = NULL;
371
372         state->out_mem_ctx = talloc_named_const(state, 0,
373                              "rpccli_unixinfo_GidToSid_out_memory");
374         if (tevent_req_nomem(state->out_mem_ctx, req)) {
375                 return tevent_req_post(req, ev);
376         }
377
378         subreq = dcerpc_unixinfo_GidToSid_send(state,
379                                                ev,
380                                                cli->binding_handle,
381                                                _gid,
382                                                _sid);
383         if (tevent_req_nomem(subreq, req)) {
384                 return tevent_req_post(req, ev);
385         }
386         tevent_req_set_callback(subreq, rpccli_unixinfo_GidToSid_done, req);
387         return req;
388 }
389
390 static void rpccli_unixinfo_GidToSid_done(struct tevent_req *subreq)
391 {
392         struct tevent_req *req = tevent_req_callback_data(
393                 subreq, struct tevent_req);
394         struct rpccli_unixinfo_GidToSid_state *state = tevent_req_data(
395                 req, struct rpccli_unixinfo_GidToSid_state);
396         NTSTATUS status;
397         TALLOC_CTX *mem_ctx;
398
399         if (state->out_mem_ctx) {
400                 mem_ctx = state->out_mem_ctx;
401         } else {
402                 mem_ctx = state;
403         }
404
405         status = dcerpc_unixinfo_GidToSid_recv(subreq,
406                                                mem_ctx,
407                                                &state->result);
408         TALLOC_FREE(subreq);
409         if (!NT_STATUS_IS_OK(status)) {
410                 tevent_req_nterror(req, status);
411                 return;
412         }
413
414         tevent_req_done(req);
415 }
416
417 NTSTATUS rpccli_unixinfo_GidToSid_recv(struct tevent_req *req,
418                                        TALLOC_CTX *mem_ctx,
419                                        NTSTATUS *result)
420 {
421         struct rpccli_unixinfo_GidToSid_state *state = tevent_req_data(
422                 req, struct rpccli_unixinfo_GidToSid_state);
423         NTSTATUS status;
424
425         if (tevent_req_is_nterror(req, &status)) {
426                 tevent_req_received(req);
427                 return status;
428         }
429
430         /* Steal possible out parameters to the callers context */
431         talloc_steal(mem_ctx, state->out_mem_ctx);
432
433         /* Return result */
434         *result = state->result;
435
436         tevent_req_received(req);
437         return NT_STATUS_OK;
438 }
439
440 NTSTATUS rpccli_unixinfo_GidToSid(struct rpc_pipe_client *cli,
441                                   TALLOC_CTX *mem_ctx,
442                                   uint64_t _gid /* [in]  */,
443                                   struct dom_sid *_sid /* [out] [ref] */)
444 {
445         NTSTATUS result;
446         NTSTATUS status;
447
448         status = dcerpc_unixinfo_GidToSid(cli->binding_handle,
449                                           mem_ctx,
450                                           _gid,
451                                           _sid,
452                                           &result);
453         if (!NT_STATUS_IS_OK(status)) {
454                 return status;
455         }
456
457         /* Return result */
458         return result;
459 }
460
461 struct rpccli_unixinfo_GetPWUid_state {
462         TALLOC_CTX *out_mem_ctx;
463         NTSTATUS result;
464 };
465
466 static void rpccli_unixinfo_GetPWUid_done(struct tevent_req *subreq);
467
468 struct tevent_req *rpccli_unixinfo_GetPWUid_send(TALLOC_CTX *mem_ctx,
469                                                  struct tevent_context *ev,
470                                                  struct rpc_pipe_client *cli,
471                                                  uint32_t *_count /* [in,out] [ref,range(0,1023)] */,
472                                                  uint64_t *_uids /* [in] [size_is(*count)] */,
473                                                  struct unixinfo_GetPWUidInfo *_infos /* [out] [size_is(*count)] */)
474 {
475         struct tevent_req *req;
476         struct rpccli_unixinfo_GetPWUid_state *state;
477         struct tevent_req *subreq;
478
479         req = tevent_req_create(mem_ctx, &state,
480                                 struct rpccli_unixinfo_GetPWUid_state);
481         if (req == NULL) {
482                 return NULL;
483         }
484         state->out_mem_ctx = NULL;
485
486         state->out_mem_ctx = talloc_named_const(state, 0,
487                              "rpccli_unixinfo_GetPWUid_out_memory");
488         if (tevent_req_nomem(state->out_mem_ctx, req)) {
489                 return tevent_req_post(req, ev);
490         }
491
492         subreq = dcerpc_unixinfo_GetPWUid_send(state,
493                                                ev,
494                                                cli->binding_handle,
495                                                _count,
496                                                _uids,
497                                                _infos);
498         if (tevent_req_nomem(subreq, req)) {
499                 return tevent_req_post(req, ev);
500         }
501         tevent_req_set_callback(subreq, rpccli_unixinfo_GetPWUid_done, req);
502         return req;
503 }
504
505 static void rpccli_unixinfo_GetPWUid_done(struct tevent_req *subreq)
506 {
507         struct tevent_req *req = tevent_req_callback_data(
508                 subreq, struct tevent_req);
509         struct rpccli_unixinfo_GetPWUid_state *state = tevent_req_data(
510                 req, struct rpccli_unixinfo_GetPWUid_state);
511         NTSTATUS status;
512         TALLOC_CTX *mem_ctx;
513
514         if (state->out_mem_ctx) {
515                 mem_ctx = state->out_mem_ctx;
516         } else {
517                 mem_ctx = state;
518         }
519
520         status = dcerpc_unixinfo_GetPWUid_recv(subreq,
521                                                mem_ctx,
522                                                &state->result);
523         TALLOC_FREE(subreq);
524         if (!NT_STATUS_IS_OK(status)) {
525                 tevent_req_nterror(req, status);
526                 return;
527         }
528
529         tevent_req_done(req);
530 }
531
532 NTSTATUS rpccli_unixinfo_GetPWUid_recv(struct tevent_req *req,
533                                        TALLOC_CTX *mem_ctx,
534                                        NTSTATUS *result)
535 {
536         struct rpccli_unixinfo_GetPWUid_state *state = tevent_req_data(
537                 req, struct rpccli_unixinfo_GetPWUid_state);
538         NTSTATUS status;
539
540         if (tevent_req_is_nterror(req, &status)) {
541                 tevent_req_received(req);
542                 return status;
543         }
544
545         /* Steal possible out parameters to the callers context */
546         talloc_steal(mem_ctx, state->out_mem_ctx);
547
548         /* Return result */
549         *result = state->result;
550
551         tevent_req_received(req);
552         return NT_STATUS_OK;
553 }
554
555 NTSTATUS rpccli_unixinfo_GetPWUid(struct rpc_pipe_client *cli,
556                                   TALLOC_CTX *mem_ctx,
557                                   uint32_t *_count /* [in,out] [ref,range(0,1023)] */,
558                                   uint64_t *_uids /* [in] [size_is(*count)] */,
559                                   struct unixinfo_GetPWUidInfo *_infos /* [out] [size_is(*count)] */)
560 {
561         NTSTATUS result;
562         NTSTATUS status;
563
564         status = dcerpc_unixinfo_GetPWUid(cli->binding_handle,
565                                           mem_ctx,
566                                           _count,
567                                           _uids,
568                                           _infos,
569                                           &result);
570         if (!NT_STATUS_IS_OK(status)) {
571                 return status;
572         }
573
574         /* Return result */
575         return result;
576 }
577