r25068: Older samba3 DCs will return DCERPC_FAULT_OP_RNG_ERROR for every opcode on the
[Samba.git] / source / librpc / gen_ndr / srv_epmapper.c
blobf64a903e10b746cebcf0171b1301ddc2b1e14689
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_epmapper.h"
9 static BOOL api_epm_Insert(pipes_struct *p)
11 struct ndr_pull *pull;
12 struct ndr_push *push;
13 NTSTATUS status;
14 DATA_BLOB blob;
15 struct epm_Insert r;
16 TALLOC_CTX *mem_ctx = talloc_init("api_epm_Insert");
18 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
19 talloc_free(mem_ctx);
20 return False;
23 pull = ndr_pull_init_blob(&blob, mem_ctx);
24 if (pull == NULL) {
25 talloc_free(mem_ctx);
26 return False;
29 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
30 status = ndr_pull_epm_Insert(pull, NDR_IN, &r);
31 if (NT_STATUS_IS_ERR(status)) {
32 talloc_free(mem_ctx);
33 return False;
36 if (DEBUGLEVEL >= 10)
37 NDR_PRINT_IN_DEBUG(epm_Insert, &r);
39 r.out.result = _epm_Insert(p, &r);
41 if (p->rng_fault_state) {
42 talloc_free(mem_ctx);
43 /* Return True here, srv_pipe_hnd.c will take care */
44 return True;
47 if (DEBUGLEVEL >= 10)
48 NDR_PRINT_OUT_DEBUG(epm_Insert, &r);
50 push = ndr_push_init_ctx(mem_ctx);
51 if (push == NULL) {
52 talloc_free(mem_ctx);
53 return False;
56 status = ndr_push_epm_Insert(push, NDR_OUT, &r);
57 if (NT_STATUS_IS_ERR(status)) {
58 talloc_free(mem_ctx);
59 return False;
62 blob = ndr_push_blob(push);
63 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
64 talloc_free(mem_ctx);
65 return False;
68 talloc_free(mem_ctx);
70 return True;
73 static BOOL api_epm_Delete(pipes_struct *p)
75 struct ndr_pull *pull;
76 struct ndr_push *push;
77 NTSTATUS status;
78 DATA_BLOB blob;
79 struct epm_Delete r;
80 TALLOC_CTX *mem_ctx = talloc_init("api_epm_Delete");
82 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
83 talloc_free(mem_ctx);
84 return False;
87 pull = ndr_pull_init_blob(&blob, mem_ctx);
88 if (pull == NULL) {
89 talloc_free(mem_ctx);
90 return False;
93 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
94 status = ndr_pull_epm_Delete(pull, NDR_IN, &r);
95 if (NT_STATUS_IS_ERR(status)) {
96 talloc_free(mem_ctx);
97 return False;
100 if (DEBUGLEVEL >= 10)
101 NDR_PRINT_IN_DEBUG(epm_Delete, &r);
103 r.out.result = _epm_Delete(p, &r);
105 if (p->rng_fault_state) {
106 talloc_free(mem_ctx);
107 /* Return True here, srv_pipe_hnd.c will take care */
108 return True;
111 if (DEBUGLEVEL >= 10)
112 NDR_PRINT_OUT_DEBUG(epm_Delete, &r);
114 push = ndr_push_init_ctx(mem_ctx);
115 if (push == NULL) {
116 talloc_free(mem_ctx);
117 return False;
120 status = ndr_push_epm_Delete(push, NDR_OUT, &r);
121 if (NT_STATUS_IS_ERR(status)) {
122 talloc_free(mem_ctx);
123 return False;
126 blob = ndr_push_blob(push);
127 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
128 talloc_free(mem_ctx);
129 return False;
132 talloc_free(mem_ctx);
134 return True;
137 static BOOL api_epm_Lookup(pipes_struct *p)
139 struct ndr_pull *pull;
140 struct ndr_push *push;
141 NTSTATUS status;
142 DATA_BLOB blob;
143 struct epm_Lookup r;
144 TALLOC_CTX *mem_ctx = talloc_init("api_epm_Lookup");
146 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
147 talloc_free(mem_ctx);
148 return False;
151 pull = ndr_pull_init_blob(&blob, mem_ctx);
152 if (pull == NULL) {
153 talloc_free(mem_ctx);
154 return False;
157 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
158 status = ndr_pull_epm_Lookup(pull, NDR_IN, &r);
159 if (NT_STATUS_IS_ERR(status)) {
160 talloc_free(mem_ctx);
161 return False;
164 if (DEBUGLEVEL >= 10)
165 NDR_PRINT_IN_DEBUG(epm_Lookup, &r);
167 ZERO_STRUCT(r.out);
168 r.out.entry_handle = r.in.entry_handle;
169 r.out.num_ents = talloc_zero(mem_ctx, uint32_t);
170 if (r.out.num_ents == NULL) {
171 talloc_free(mem_ctx);
172 return False;
175 r.out.entries = talloc_zero_array(mem_ctx, struct epm_entry_t, r.in.max_ents);
176 if (r.out.entries == NULL) {
177 talloc_free(mem_ctx);
178 return False;
181 r.out.result = _epm_Lookup(p, &r);
183 if (p->rng_fault_state) {
184 talloc_free(mem_ctx);
185 /* Return True here, srv_pipe_hnd.c will take care */
186 return True;
189 if (DEBUGLEVEL >= 10)
190 NDR_PRINT_OUT_DEBUG(epm_Lookup, &r);
192 push = ndr_push_init_ctx(mem_ctx);
193 if (push == NULL) {
194 talloc_free(mem_ctx);
195 return False;
198 status = ndr_push_epm_Lookup(push, NDR_OUT, &r);
199 if (NT_STATUS_IS_ERR(status)) {
200 talloc_free(mem_ctx);
201 return False;
204 blob = ndr_push_blob(push);
205 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
206 talloc_free(mem_ctx);
207 return False;
210 talloc_free(mem_ctx);
212 return True;
215 static BOOL api_epm_Map(pipes_struct *p)
217 struct ndr_pull *pull;
218 struct ndr_push *push;
219 NTSTATUS status;
220 DATA_BLOB blob;
221 struct epm_Map r;
222 TALLOC_CTX *mem_ctx = talloc_init("api_epm_Map");
224 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
225 talloc_free(mem_ctx);
226 return False;
229 pull = ndr_pull_init_blob(&blob, mem_ctx);
230 if (pull == NULL) {
231 talloc_free(mem_ctx);
232 return False;
235 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
236 status = ndr_pull_epm_Map(pull, NDR_IN, &r);
237 if (NT_STATUS_IS_ERR(status)) {
238 talloc_free(mem_ctx);
239 return False;
242 if (DEBUGLEVEL >= 10)
243 NDR_PRINT_IN_DEBUG(epm_Map, &r);
245 ZERO_STRUCT(r.out);
246 r.out.entry_handle = r.in.entry_handle;
247 r.out.num_towers = talloc_zero(mem_ctx, uint32_t);
248 if (r.out.num_towers == NULL) {
249 talloc_free(mem_ctx);
250 return False;
253 r.out.towers = talloc_zero_array(mem_ctx, struct epm_twr_p_t, r.in.max_towers);
254 if (r.out.towers == NULL) {
255 talloc_free(mem_ctx);
256 return False;
259 r.out.result = _epm_Map(p, &r);
261 if (p->rng_fault_state) {
262 talloc_free(mem_ctx);
263 /* Return True here, srv_pipe_hnd.c will take care */
264 return True;
267 if (DEBUGLEVEL >= 10)
268 NDR_PRINT_OUT_DEBUG(epm_Map, &r);
270 push = ndr_push_init_ctx(mem_ctx);
271 if (push == NULL) {
272 talloc_free(mem_ctx);
273 return False;
276 status = ndr_push_epm_Map(push, NDR_OUT, &r);
277 if (NT_STATUS_IS_ERR(status)) {
278 talloc_free(mem_ctx);
279 return False;
282 blob = ndr_push_blob(push);
283 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
284 talloc_free(mem_ctx);
285 return False;
288 talloc_free(mem_ctx);
290 return True;
293 static BOOL api_epm_LookupHandleFree(pipes_struct *p)
295 struct ndr_pull *pull;
296 struct ndr_push *push;
297 NTSTATUS status;
298 DATA_BLOB blob;
299 struct epm_LookupHandleFree r;
300 TALLOC_CTX *mem_ctx = talloc_init("api_epm_LookupHandleFree");
302 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
303 talloc_free(mem_ctx);
304 return False;
307 pull = ndr_pull_init_blob(&blob, mem_ctx);
308 if (pull == NULL) {
309 talloc_free(mem_ctx);
310 return False;
313 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
314 status = ndr_pull_epm_LookupHandleFree(pull, NDR_IN, &r);
315 if (NT_STATUS_IS_ERR(status)) {
316 talloc_free(mem_ctx);
317 return False;
320 if (DEBUGLEVEL >= 10)
321 NDR_PRINT_IN_DEBUG(epm_LookupHandleFree, &r);
323 ZERO_STRUCT(r.out);
324 r.out.entry_handle = r.in.entry_handle;
325 r.out.result = _epm_LookupHandleFree(p, &r);
327 if (p->rng_fault_state) {
328 talloc_free(mem_ctx);
329 /* Return True here, srv_pipe_hnd.c will take care */
330 return True;
333 if (DEBUGLEVEL >= 10)
334 NDR_PRINT_OUT_DEBUG(epm_LookupHandleFree, &r);
336 push = ndr_push_init_ctx(mem_ctx);
337 if (push == NULL) {
338 talloc_free(mem_ctx);
339 return False;
342 status = ndr_push_epm_LookupHandleFree(push, NDR_OUT, &r);
343 if (NT_STATUS_IS_ERR(status)) {
344 talloc_free(mem_ctx);
345 return False;
348 blob = ndr_push_blob(push);
349 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
350 talloc_free(mem_ctx);
351 return False;
354 talloc_free(mem_ctx);
356 return True;
359 static BOOL api_epm_InqObject(pipes_struct *p)
361 struct ndr_pull *pull;
362 struct ndr_push *push;
363 NTSTATUS status;
364 DATA_BLOB blob;
365 struct epm_InqObject r;
366 TALLOC_CTX *mem_ctx = talloc_init("api_epm_InqObject");
368 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
369 talloc_free(mem_ctx);
370 return False;
373 pull = ndr_pull_init_blob(&blob, mem_ctx);
374 if (pull == NULL) {
375 talloc_free(mem_ctx);
376 return False;
379 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
380 status = ndr_pull_epm_InqObject(pull, NDR_IN, &r);
381 if (NT_STATUS_IS_ERR(status)) {
382 talloc_free(mem_ctx);
383 return False;
386 if (DEBUGLEVEL >= 10)
387 NDR_PRINT_IN_DEBUG(epm_InqObject, &r);
389 r.out.result = _epm_InqObject(p, &r);
391 if (p->rng_fault_state) {
392 talloc_free(mem_ctx);
393 /* Return True here, srv_pipe_hnd.c will take care */
394 return True;
397 if (DEBUGLEVEL >= 10)
398 NDR_PRINT_OUT_DEBUG(epm_InqObject, &r);
400 push = ndr_push_init_ctx(mem_ctx);
401 if (push == NULL) {
402 talloc_free(mem_ctx);
403 return False;
406 status = ndr_push_epm_InqObject(push, NDR_OUT, &r);
407 if (NT_STATUS_IS_ERR(status)) {
408 talloc_free(mem_ctx);
409 return False;
412 blob = ndr_push_blob(push);
413 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
414 talloc_free(mem_ctx);
415 return False;
418 talloc_free(mem_ctx);
420 return True;
423 static BOOL api_epm_MgmtDelete(pipes_struct *p)
425 struct ndr_pull *pull;
426 struct ndr_push *push;
427 NTSTATUS status;
428 DATA_BLOB blob;
429 struct epm_MgmtDelete r;
430 TALLOC_CTX *mem_ctx = talloc_init("api_epm_MgmtDelete");
432 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
433 talloc_free(mem_ctx);
434 return False;
437 pull = ndr_pull_init_blob(&blob, mem_ctx);
438 if (pull == NULL) {
439 talloc_free(mem_ctx);
440 return False;
443 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
444 status = ndr_pull_epm_MgmtDelete(pull, NDR_IN, &r);
445 if (NT_STATUS_IS_ERR(status)) {
446 talloc_free(mem_ctx);
447 return False;
450 if (DEBUGLEVEL >= 10)
451 NDR_PRINT_IN_DEBUG(epm_MgmtDelete, &r);
453 r.out.result = _epm_MgmtDelete(p, &r);
455 if (p->rng_fault_state) {
456 talloc_free(mem_ctx);
457 /* Return True here, srv_pipe_hnd.c will take care */
458 return True;
461 if (DEBUGLEVEL >= 10)
462 NDR_PRINT_OUT_DEBUG(epm_MgmtDelete, &r);
464 push = ndr_push_init_ctx(mem_ctx);
465 if (push == NULL) {
466 talloc_free(mem_ctx);
467 return False;
470 status = ndr_push_epm_MgmtDelete(push, NDR_OUT, &r);
471 if (NT_STATUS_IS_ERR(status)) {
472 talloc_free(mem_ctx);
473 return False;
476 blob = ndr_push_blob(push);
477 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
478 talloc_free(mem_ctx);
479 return False;
482 talloc_free(mem_ctx);
484 return True;
487 static BOOL api_epm_MapAuth(pipes_struct *p)
489 struct ndr_pull *pull;
490 struct ndr_push *push;
491 NTSTATUS status;
492 DATA_BLOB blob;
493 struct epm_MapAuth r;
494 TALLOC_CTX *mem_ctx = talloc_init("api_epm_MapAuth");
496 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
497 talloc_free(mem_ctx);
498 return False;
501 pull = ndr_pull_init_blob(&blob, mem_ctx);
502 if (pull == NULL) {
503 talloc_free(mem_ctx);
504 return False;
507 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
508 status = ndr_pull_epm_MapAuth(pull, NDR_IN, &r);
509 if (NT_STATUS_IS_ERR(status)) {
510 talloc_free(mem_ctx);
511 return False;
514 if (DEBUGLEVEL >= 10)
515 NDR_PRINT_IN_DEBUG(epm_MapAuth, &r);
517 r.out.result = _epm_MapAuth(p, &r);
519 if (p->rng_fault_state) {
520 talloc_free(mem_ctx);
521 /* Return True here, srv_pipe_hnd.c will take care */
522 return True;
525 if (DEBUGLEVEL >= 10)
526 NDR_PRINT_OUT_DEBUG(epm_MapAuth, &r);
528 push = ndr_push_init_ctx(mem_ctx);
529 if (push == NULL) {
530 talloc_free(mem_ctx);
531 return False;
534 status = ndr_push_epm_MapAuth(push, NDR_OUT, &r);
535 if (NT_STATUS_IS_ERR(status)) {
536 talloc_free(mem_ctx);
537 return False;
540 blob = ndr_push_blob(push);
541 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
542 talloc_free(mem_ctx);
543 return False;
546 talloc_free(mem_ctx);
548 return True;
552 /* Tables */
553 static struct api_struct api_epmapper_cmds[] =
555 {"EPM_INSERT", DCERPC_EPM_INSERT, api_epm_Insert},
556 {"EPM_DELETE", DCERPC_EPM_DELETE, api_epm_Delete},
557 {"EPM_LOOKUP", DCERPC_EPM_LOOKUP, api_epm_Lookup},
558 {"EPM_MAP", DCERPC_EPM_MAP, api_epm_Map},
559 {"EPM_LOOKUPHANDLEFREE", DCERPC_EPM_LOOKUPHANDLEFREE, api_epm_LookupHandleFree},
560 {"EPM_INQOBJECT", DCERPC_EPM_INQOBJECT, api_epm_InqObject},
561 {"EPM_MGMTDELETE", DCERPC_EPM_MGMTDELETE, api_epm_MgmtDelete},
562 {"EPM_MAPAUTH", DCERPC_EPM_MAPAUTH, api_epm_MapAuth},
565 void epmapper_get_pipe_fns(struct api_struct **fns, int *n_fns)
567 *fns = api_epmapper_cmds;
568 *n_fns = sizeof(api_epmapper_cmds) / sizeof(struct api_struct);
571 NTSTATUS rpc_epmapper_init(void)
573 return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "epmapper", "epmapper", api_epmapper_cmds, sizeof(api_epmapper_cmds) / sizeof(struct api_struct));