RIP BOOL. Convert BOOL -> bool. I found a few interesting
[samba.git] / source3 / librpc / gen_ndr / srv_epmapper.c
1 /*
2  * Unix SMB/CIFS implementation.
3  * server auto-generated by pidl. DO NOT MODIFY!
4  */
5
6 #include "includes.h"
7 #include "librpc/gen_ndr/srv_epmapper.h"
8
9 static bool api_epm_Insert(pipes_struct *p)
10 {
11         const struct ndr_interface_call *call;
12         struct ndr_pull *pull;
13         struct ndr_push *push;
14         NTSTATUS status;
15         DATA_BLOB blob;
16         struct epm_Insert *r;
17         
18         call = &ndr_table_epmapper.calls[NDR_EPM_INSERT];
19         
20         r = talloc(NULL, struct epm_Insert);
21         if (r == NULL) {
22                 return False;
23         }
24         
25         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
26                 talloc_free(r);
27                 return False;
28         }
29         
30         pull = ndr_pull_init_blob(&blob, r);
31         if (pull == NULL) {
32                 talloc_free(r);
33                 return False;
34         }
35         
36         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
37         status = call->ndr_pull(pull, NDR_IN, r);
38         if (NT_STATUS_IS_ERR(status)) {
39                 talloc_free(r);
40                 return False;
41         }
42         
43         if (DEBUGLEVEL >= 10)
44                 NDR_PRINT_IN_DEBUG(epm_Insert, r);
45         
46         r->out.result = _epm_Insert(p, r);
47         
48         if (p->rng_fault_state) {
49                 talloc_free(r);
50                 /* Return True here, srv_pipe_hnd.c will take care */
51                 return True;
52         }
53         
54         if (DEBUGLEVEL >= 10)
55                 NDR_PRINT_OUT_DEBUG(epm_Insert, r);
56         
57         push = ndr_push_init_ctx(r);
58         if (push == NULL) {
59                 talloc_free(r);
60                 return False;
61         }
62         
63         status = call->ndr_push(push, NDR_OUT, r);
64         if (NT_STATUS_IS_ERR(status)) {
65                 talloc_free(r);
66                 return False;
67         }
68         
69         blob = ndr_push_blob(push);
70         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
71                 talloc_free(r);
72                 return False;
73         }
74         
75         talloc_free(r);
76         
77         return True;
78 }
79
80 static bool api_epm_Delete(pipes_struct *p)
81 {
82         const struct ndr_interface_call *call;
83         struct ndr_pull *pull;
84         struct ndr_push *push;
85         NTSTATUS status;
86         DATA_BLOB blob;
87         struct epm_Delete *r;
88         
89         call = &ndr_table_epmapper.calls[NDR_EPM_DELETE];
90         
91         r = talloc(NULL, struct epm_Delete);
92         if (r == NULL) {
93                 return False;
94         }
95         
96         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
97                 talloc_free(r);
98                 return False;
99         }
100         
101         pull = ndr_pull_init_blob(&blob, r);
102         if (pull == NULL) {
103                 talloc_free(r);
104                 return False;
105         }
106         
107         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
108         status = call->ndr_pull(pull, NDR_IN, r);
109         if (NT_STATUS_IS_ERR(status)) {
110                 talloc_free(r);
111                 return False;
112         }
113         
114         if (DEBUGLEVEL >= 10)
115                 NDR_PRINT_IN_DEBUG(epm_Delete, r);
116         
117         r->out.result = _epm_Delete(p, r);
118         
119         if (p->rng_fault_state) {
120                 talloc_free(r);
121                 /* Return True here, srv_pipe_hnd.c will take care */
122                 return True;
123         }
124         
125         if (DEBUGLEVEL >= 10)
126                 NDR_PRINT_OUT_DEBUG(epm_Delete, r);
127         
128         push = ndr_push_init_ctx(r);
129         if (push == NULL) {
130                 talloc_free(r);
131                 return False;
132         }
133         
134         status = call->ndr_push(push, NDR_OUT, r);
135         if (NT_STATUS_IS_ERR(status)) {
136                 talloc_free(r);
137                 return False;
138         }
139         
140         blob = ndr_push_blob(push);
141         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
142                 talloc_free(r);
143                 return False;
144         }
145         
146         talloc_free(r);
147         
148         return True;
149 }
150
151 static bool api_epm_Lookup(pipes_struct *p)
152 {
153         const struct ndr_interface_call *call;
154         struct ndr_pull *pull;
155         struct ndr_push *push;
156         NTSTATUS status;
157         DATA_BLOB blob;
158         struct epm_Lookup *r;
159         
160         call = &ndr_table_epmapper.calls[NDR_EPM_LOOKUP];
161         
162         r = talloc(NULL, struct epm_Lookup);
163         if (r == NULL) {
164                 return False;
165         }
166         
167         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
168                 talloc_free(r);
169                 return False;
170         }
171         
172         pull = ndr_pull_init_blob(&blob, r);
173         if (pull == NULL) {
174                 talloc_free(r);
175                 return False;
176         }
177         
178         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
179         status = call->ndr_pull(pull, NDR_IN, r);
180         if (NT_STATUS_IS_ERR(status)) {
181                 talloc_free(r);
182                 return False;
183         }
184         
185         if (DEBUGLEVEL >= 10)
186                 NDR_PRINT_IN_DEBUG(epm_Lookup, r);
187         
188         ZERO_STRUCT(r->out);
189         r->out.entry_handle = r->in.entry_handle;
190         r->out.num_ents = talloc_zero(r, uint32_t);
191         if (r->out.num_ents == NULL) {
192                 talloc_free(r);
193                 return False;
194         }
195         
196         r->out.entries = talloc_zero_array(r, struct epm_entry_t, r->in.max_ents);
197         if (r->out.entries == NULL) {
198                 talloc_free(r);
199                 return False;
200         }
201         
202         r->out.result = _epm_Lookup(p, r);
203         
204         if (p->rng_fault_state) {
205                 talloc_free(r);
206                 /* Return True here, srv_pipe_hnd.c will take care */
207                 return True;
208         }
209         
210         if (DEBUGLEVEL >= 10)
211                 NDR_PRINT_OUT_DEBUG(epm_Lookup, r);
212         
213         push = ndr_push_init_ctx(r);
214         if (push == NULL) {
215                 talloc_free(r);
216                 return False;
217         }
218         
219         status = call->ndr_push(push, NDR_OUT, r);
220         if (NT_STATUS_IS_ERR(status)) {
221                 talloc_free(r);
222                 return False;
223         }
224         
225         blob = ndr_push_blob(push);
226         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
227                 talloc_free(r);
228                 return False;
229         }
230         
231         talloc_free(r);
232         
233         return True;
234 }
235
236 static bool api_epm_Map(pipes_struct *p)
237 {
238         const struct ndr_interface_call *call;
239         struct ndr_pull *pull;
240         struct ndr_push *push;
241         NTSTATUS status;
242         DATA_BLOB blob;
243         struct epm_Map *r;
244         
245         call = &ndr_table_epmapper.calls[NDR_EPM_MAP];
246         
247         r = talloc(NULL, struct epm_Map);
248         if (r == NULL) {
249                 return False;
250         }
251         
252         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
253                 talloc_free(r);
254                 return False;
255         }
256         
257         pull = ndr_pull_init_blob(&blob, r);
258         if (pull == NULL) {
259                 talloc_free(r);
260                 return False;
261         }
262         
263         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
264         status = call->ndr_pull(pull, NDR_IN, r);
265         if (NT_STATUS_IS_ERR(status)) {
266                 talloc_free(r);
267                 return False;
268         }
269         
270         if (DEBUGLEVEL >= 10)
271                 NDR_PRINT_IN_DEBUG(epm_Map, r);
272         
273         ZERO_STRUCT(r->out);
274         r->out.entry_handle = r->in.entry_handle;
275         r->out.num_towers = talloc_zero(r, uint32_t);
276         if (r->out.num_towers == NULL) {
277                 talloc_free(r);
278                 return False;
279         }
280         
281         r->out.towers = talloc_zero_array(r, struct epm_twr_p_t, r->in.max_towers);
282         if (r->out.towers == NULL) {
283                 talloc_free(r);
284                 return False;
285         }
286         
287         r->out.result = _epm_Map(p, r);
288         
289         if (p->rng_fault_state) {
290                 talloc_free(r);
291                 /* Return True here, srv_pipe_hnd.c will take care */
292                 return True;
293         }
294         
295         if (DEBUGLEVEL >= 10)
296                 NDR_PRINT_OUT_DEBUG(epm_Map, r);
297         
298         push = ndr_push_init_ctx(r);
299         if (push == NULL) {
300                 talloc_free(r);
301                 return False;
302         }
303         
304         status = call->ndr_push(push, NDR_OUT, r);
305         if (NT_STATUS_IS_ERR(status)) {
306                 talloc_free(r);
307                 return False;
308         }
309         
310         blob = ndr_push_blob(push);
311         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
312                 talloc_free(r);
313                 return False;
314         }
315         
316         talloc_free(r);
317         
318         return True;
319 }
320
321 static bool api_epm_LookupHandleFree(pipes_struct *p)
322 {
323         const struct ndr_interface_call *call;
324         struct ndr_pull *pull;
325         struct ndr_push *push;
326         NTSTATUS status;
327         DATA_BLOB blob;
328         struct epm_LookupHandleFree *r;
329         
330         call = &ndr_table_epmapper.calls[NDR_EPM_LOOKUPHANDLEFREE];
331         
332         r = talloc(NULL, struct epm_LookupHandleFree);
333         if (r == NULL) {
334                 return False;
335         }
336         
337         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
338                 talloc_free(r);
339                 return False;
340         }
341         
342         pull = ndr_pull_init_blob(&blob, r);
343         if (pull == NULL) {
344                 talloc_free(r);
345                 return False;
346         }
347         
348         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
349         status = call->ndr_pull(pull, NDR_IN, r);
350         if (NT_STATUS_IS_ERR(status)) {
351                 talloc_free(r);
352                 return False;
353         }
354         
355         if (DEBUGLEVEL >= 10)
356                 NDR_PRINT_IN_DEBUG(epm_LookupHandleFree, r);
357         
358         ZERO_STRUCT(r->out);
359         r->out.entry_handle = r->in.entry_handle;
360         r->out.result = _epm_LookupHandleFree(p, r);
361         
362         if (p->rng_fault_state) {
363                 talloc_free(r);
364                 /* Return True here, srv_pipe_hnd.c will take care */
365                 return True;
366         }
367         
368         if (DEBUGLEVEL >= 10)
369                 NDR_PRINT_OUT_DEBUG(epm_LookupHandleFree, r);
370         
371         push = ndr_push_init_ctx(r);
372         if (push == NULL) {
373                 talloc_free(r);
374                 return False;
375         }
376         
377         status = call->ndr_push(push, NDR_OUT, r);
378         if (NT_STATUS_IS_ERR(status)) {
379                 talloc_free(r);
380                 return False;
381         }
382         
383         blob = ndr_push_blob(push);
384         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
385                 talloc_free(r);
386                 return False;
387         }
388         
389         talloc_free(r);
390         
391         return True;
392 }
393
394 static bool api_epm_InqObject(pipes_struct *p)
395 {
396         const struct ndr_interface_call *call;
397         struct ndr_pull *pull;
398         struct ndr_push *push;
399         NTSTATUS status;
400         DATA_BLOB blob;
401         struct epm_InqObject *r;
402         
403         call = &ndr_table_epmapper.calls[NDR_EPM_INQOBJECT];
404         
405         r = talloc(NULL, struct epm_InqObject);
406         if (r == NULL) {
407                 return False;
408         }
409         
410         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
411                 talloc_free(r);
412                 return False;
413         }
414         
415         pull = ndr_pull_init_blob(&blob, r);
416         if (pull == NULL) {
417                 talloc_free(r);
418                 return False;
419         }
420         
421         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
422         status = call->ndr_pull(pull, NDR_IN, r);
423         if (NT_STATUS_IS_ERR(status)) {
424                 talloc_free(r);
425                 return False;
426         }
427         
428         if (DEBUGLEVEL >= 10)
429                 NDR_PRINT_IN_DEBUG(epm_InqObject, r);
430         
431         r->out.result = _epm_InqObject(p, r);
432         
433         if (p->rng_fault_state) {
434                 talloc_free(r);
435                 /* Return True here, srv_pipe_hnd.c will take care */
436                 return True;
437         }
438         
439         if (DEBUGLEVEL >= 10)
440                 NDR_PRINT_OUT_DEBUG(epm_InqObject, r);
441         
442         push = ndr_push_init_ctx(r);
443         if (push == NULL) {
444                 talloc_free(r);
445                 return False;
446         }
447         
448         status = call->ndr_push(push, NDR_OUT, r);
449         if (NT_STATUS_IS_ERR(status)) {
450                 talloc_free(r);
451                 return False;
452         }
453         
454         blob = ndr_push_blob(push);
455         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
456                 talloc_free(r);
457                 return False;
458         }
459         
460         talloc_free(r);
461         
462         return True;
463 }
464
465 static bool api_epm_MgmtDelete(pipes_struct *p)
466 {
467         const struct ndr_interface_call *call;
468         struct ndr_pull *pull;
469         struct ndr_push *push;
470         NTSTATUS status;
471         DATA_BLOB blob;
472         struct epm_MgmtDelete *r;
473         
474         call = &ndr_table_epmapper.calls[NDR_EPM_MGMTDELETE];
475         
476         r = talloc(NULL, struct epm_MgmtDelete);
477         if (r == NULL) {
478                 return False;
479         }
480         
481         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
482                 talloc_free(r);
483                 return False;
484         }
485         
486         pull = ndr_pull_init_blob(&blob, r);
487         if (pull == NULL) {
488                 talloc_free(r);
489                 return False;
490         }
491         
492         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
493         status = call->ndr_pull(pull, NDR_IN, r);
494         if (NT_STATUS_IS_ERR(status)) {
495                 talloc_free(r);
496                 return False;
497         }
498         
499         if (DEBUGLEVEL >= 10)
500                 NDR_PRINT_IN_DEBUG(epm_MgmtDelete, r);
501         
502         r->out.result = _epm_MgmtDelete(p, r);
503         
504         if (p->rng_fault_state) {
505                 talloc_free(r);
506                 /* Return True here, srv_pipe_hnd.c will take care */
507                 return True;
508         }
509         
510         if (DEBUGLEVEL >= 10)
511                 NDR_PRINT_OUT_DEBUG(epm_MgmtDelete, r);
512         
513         push = ndr_push_init_ctx(r);
514         if (push == NULL) {
515                 talloc_free(r);
516                 return False;
517         }
518         
519         status = call->ndr_push(push, NDR_OUT, r);
520         if (NT_STATUS_IS_ERR(status)) {
521                 talloc_free(r);
522                 return False;
523         }
524         
525         blob = ndr_push_blob(push);
526         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
527                 talloc_free(r);
528                 return False;
529         }
530         
531         talloc_free(r);
532         
533         return True;
534 }
535
536 static bool api_epm_MapAuth(pipes_struct *p)
537 {
538         const struct ndr_interface_call *call;
539         struct ndr_pull *pull;
540         struct ndr_push *push;
541         NTSTATUS status;
542         DATA_BLOB blob;
543         struct epm_MapAuth *r;
544         
545         call = &ndr_table_epmapper.calls[NDR_EPM_MAPAUTH];
546         
547         r = talloc(NULL, struct epm_MapAuth);
548         if (r == NULL) {
549                 return False;
550         }
551         
552         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
553                 talloc_free(r);
554                 return False;
555         }
556         
557         pull = ndr_pull_init_blob(&blob, r);
558         if (pull == NULL) {
559                 talloc_free(r);
560                 return False;
561         }
562         
563         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
564         status = call->ndr_pull(pull, NDR_IN, r);
565         if (NT_STATUS_IS_ERR(status)) {
566                 talloc_free(r);
567                 return False;
568         }
569         
570         if (DEBUGLEVEL >= 10)
571                 NDR_PRINT_IN_DEBUG(epm_MapAuth, r);
572         
573         r->out.result = _epm_MapAuth(p, r);
574         
575         if (p->rng_fault_state) {
576                 talloc_free(r);
577                 /* Return True here, srv_pipe_hnd.c will take care */
578                 return True;
579         }
580         
581         if (DEBUGLEVEL >= 10)
582                 NDR_PRINT_OUT_DEBUG(epm_MapAuth, r);
583         
584         push = ndr_push_init_ctx(r);
585         if (push == NULL) {
586                 talloc_free(r);
587                 return False;
588         }
589         
590         status = call->ndr_push(push, NDR_OUT, r);
591         if (NT_STATUS_IS_ERR(status)) {
592                 talloc_free(r);
593                 return False;
594         }
595         
596         blob = ndr_push_blob(push);
597         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
598                 talloc_free(r);
599                 return False;
600         }
601         
602         talloc_free(r);
603         
604         return True;
605 }
606
607
608 /* Tables */
609 static struct api_struct api_epmapper_cmds[] = 
610 {
611         {"EPM_INSERT", NDR_EPM_INSERT, api_epm_Insert},
612         {"EPM_DELETE", NDR_EPM_DELETE, api_epm_Delete},
613         {"EPM_LOOKUP", NDR_EPM_LOOKUP, api_epm_Lookup},
614         {"EPM_MAP", NDR_EPM_MAP, api_epm_Map},
615         {"EPM_LOOKUPHANDLEFREE", NDR_EPM_LOOKUPHANDLEFREE, api_epm_LookupHandleFree},
616         {"EPM_INQOBJECT", NDR_EPM_INQOBJECT, api_epm_InqObject},
617         {"EPM_MGMTDELETE", NDR_EPM_MGMTDELETE, api_epm_MgmtDelete},
618         {"EPM_MAPAUTH", NDR_EPM_MAPAUTH, api_epm_MapAuth},
619 };
620
621 void epmapper_get_pipe_fns(struct api_struct **fns, int *n_fns)
622 {
623         *fns = api_epmapper_cmds;
624         *n_fns = sizeof(api_epmapper_cmds) / sizeof(struct api_struct);
625 }
626
627 NTSTATUS rpc_epmapper_init(void)
628 {
629         return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "epmapper", "epmapper", api_epmapper_cmds, sizeof(api_epmapper_cmds) / sizeof(struct api_struct));
630 }