2 * Unix SMB/CIFS implementation.
3 * server auto-generated by pidl. DO NOT MODIFY!
8 #include "bin/default/librpc/gen_ndr/srv_dnsserver.h"
10 static bool api_DnssrvOperation(struct pipes_struct *p)
12 const struct ndr_interface_call *call;
13 struct ndr_pull *pull;
14 struct ndr_push *push;
15 enum ndr_err_code ndr_err;
16 struct DnssrvOperation *r;
18 call = &ndr_table_dnsserver.calls[NDR_DNSSRVOPERATION];
20 r = talloc(talloc_tos(), struct DnssrvOperation);
25 pull = ndr_pull_init_blob(&p->in_data.data, r);
31 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
33 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
35 ndr_err = call->ndr_pull(pull, NDR_IN, r);
36 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
41 if (DEBUGLEVEL >= 10) {
42 NDR_PRINT_FUNCTION_DEBUG(DnssrvOperation, NDR_IN, r);
45 r->out.result = _DnssrvOperation(p, r);
49 /* Return true here, srv_pipe_hnd.c will take care */
53 if (DEBUGLEVEL >= 10) {
54 NDR_PRINT_FUNCTION_DEBUG(DnssrvOperation, NDR_OUT | NDR_SET_VALUES, r);
57 push = ndr_push_init_ctx(r);
64 * carry over the pointer count to the reply in case we are
65 * using full pointer. See NDR specification for full pointers
67 push->ptr_count = pull->ptr_count;
69 ndr_err = call->ndr_push(push, NDR_OUT, r);
70 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
75 p->out_data.rdata = ndr_push_blob(push);
76 talloc_steal(p->mem_ctx, p->out_data.rdata.data);
83 static bool api_DnssrvQuery(struct pipes_struct *p)
85 const struct ndr_interface_call *call;
86 struct ndr_pull *pull;
87 struct ndr_push *push;
88 enum ndr_err_code ndr_err;
89 struct DnssrvQuery *r;
91 call = &ndr_table_dnsserver.calls[NDR_DNSSRVQUERY];
93 r = talloc(talloc_tos(), struct DnssrvQuery);
98 pull = ndr_pull_init_blob(&p->in_data.data, r);
104 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
106 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
108 ndr_err = call->ndr_pull(pull, NDR_IN, r);
109 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
114 if (DEBUGLEVEL >= 10) {
115 NDR_PRINT_FUNCTION_DEBUG(DnssrvQuery, NDR_IN, r);
119 r->out.pdwTypeId = talloc_zero(r, enum DNS_RPC_TYPEID);
120 if (r->out.pdwTypeId == NULL) {
125 r->out.ppData = talloc_zero(r, union DNSSRV_RPC_UNION);
126 if (r->out.ppData == NULL) {
131 r->out.result = _DnssrvQuery(p, r);
133 if (p->fault_state) {
135 /* Return true here, srv_pipe_hnd.c will take care */
139 if (DEBUGLEVEL >= 10) {
140 NDR_PRINT_FUNCTION_DEBUG(DnssrvQuery, NDR_OUT | NDR_SET_VALUES, r);
143 push = ndr_push_init_ctx(r);
150 * carry over the pointer count to the reply in case we are
151 * using full pointer. See NDR specification for full pointers
153 push->ptr_count = pull->ptr_count;
155 ndr_err = call->ndr_push(push, NDR_OUT, r);
156 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
161 p->out_data.rdata = ndr_push_blob(push);
162 talloc_steal(p->mem_ctx, p->out_data.rdata.data);
169 static bool api_DnssrvComplexOperation(struct 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 struct DnssrvComplexOperation *r;
177 call = &ndr_table_dnsserver.calls[NDR_DNSSRVCOMPLEXOPERATION];
179 r = talloc(talloc_tos(), struct DnssrvComplexOperation);
184 pull = ndr_pull_init_blob(&p->in_data.data, r);
190 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
192 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
194 ndr_err = call->ndr_pull(pull, NDR_IN, r);
195 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
200 if (DEBUGLEVEL >= 10) {
201 NDR_PRINT_FUNCTION_DEBUG(DnssrvComplexOperation, NDR_IN, r);
205 r->out.pdwTypeOut = talloc_zero(r, enum DNS_RPC_TYPEID);
206 if (r->out.pdwTypeOut == NULL) {
211 r->out.ppDataOut = talloc_zero(r, union DNSSRV_RPC_UNION);
212 if (r->out.ppDataOut == NULL) {
217 r->out.result = _DnssrvComplexOperation(p, r);
219 if (p->fault_state) {
221 /* Return true here, srv_pipe_hnd.c will take care */
225 if (DEBUGLEVEL >= 10) {
226 NDR_PRINT_FUNCTION_DEBUG(DnssrvComplexOperation, NDR_OUT | NDR_SET_VALUES, r);
229 push = ndr_push_init_ctx(r);
236 * carry over the pointer count to the reply in case we are
237 * using full pointer. See NDR specification for full pointers
239 push->ptr_count = pull->ptr_count;
241 ndr_err = call->ndr_push(push, NDR_OUT, r);
242 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
247 p->out_data.rdata = ndr_push_blob(push);
248 talloc_steal(p->mem_ctx, p->out_data.rdata.data);
255 static bool api_DnssrvEnumRecords(struct pipes_struct *p)
257 const struct ndr_interface_call *call;
258 struct ndr_pull *pull;
259 struct ndr_push *push;
260 enum ndr_err_code ndr_err;
261 struct DnssrvEnumRecords *r;
263 call = &ndr_table_dnsserver.calls[NDR_DNSSRVENUMRECORDS];
265 r = talloc(talloc_tos(), struct DnssrvEnumRecords);
270 pull = ndr_pull_init_blob(&p->in_data.data, r);
276 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
278 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
280 ndr_err = call->ndr_pull(pull, NDR_IN, r);
281 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
286 if (DEBUGLEVEL >= 10) {
287 NDR_PRINT_FUNCTION_DEBUG(DnssrvEnumRecords, NDR_IN, r);
291 r->out.pdwBufferLength = talloc_zero(r, uint32_t);
292 if (r->out.pdwBufferLength == NULL) {
297 r->out.pBuffer = talloc_zero(r, struct DNS_RPC_RECORDS_ARRAY *);
298 if (r->out.pBuffer == NULL) {
303 r->out.result = _DnssrvEnumRecords(p, r);
305 if (p->fault_state) {
307 /* Return true here, srv_pipe_hnd.c will take care */
311 if (DEBUGLEVEL >= 10) {
312 NDR_PRINT_FUNCTION_DEBUG(DnssrvEnumRecords, NDR_OUT | NDR_SET_VALUES, r);
315 push = ndr_push_init_ctx(r);
322 * carry over the pointer count to the reply in case we are
323 * using full pointer. See NDR specification for full pointers
325 push->ptr_count = pull->ptr_count;
327 ndr_err = call->ndr_push(push, NDR_OUT, r);
328 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
333 p->out_data.rdata = ndr_push_blob(push);
334 talloc_steal(p->mem_ctx, p->out_data.rdata.data);
341 static bool api_DnssrvUpdateRecord(struct pipes_struct *p)
343 const struct ndr_interface_call *call;
344 struct ndr_pull *pull;
345 struct ndr_push *push;
346 enum ndr_err_code ndr_err;
347 struct DnssrvUpdateRecord *r;
349 call = &ndr_table_dnsserver.calls[NDR_DNSSRVUPDATERECORD];
351 r = talloc(talloc_tos(), struct DnssrvUpdateRecord);
356 pull = ndr_pull_init_blob(&p->in_data.data, r);
362 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
364 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
366 ndr_err = call->ndr_pull(pull, NDR_IN, r);
367 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
372 if (DEBUGLEVEL >= 10) {
373 NDR_PRINT_FUNCTION_DEBUG(DnssrvUpdateRecord, NDR_IN, r);
376 r->out.result = _DnssrvUpdateRecord(p, r);
378 if (p->fault_state) {
380 /* Return true here, srv_pipe_hnd.c will take care */
384 if (DEBUGLEVEL >= 10) {
385 NDR_PRINT_FUNCTION_DEBUG(DnssrvUpdateRecord, NDR_OUT | NDR_SET_VALUES, r);
388 push = ndr_push_init_ctx(r);
395 * carry over the pointer count to the reply in case we are
396 * using full pointer. See NDR specification for full pointers
398 push->ptr_count = pull->ptr_count;
400 ndr_err = call->ndr_push(push, NDR_OUT, r);
401 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
406 p->out_data.rdata = ndr_push_blob(push);
407 talloc_steal(p->mem_ctx, p->out_data.rdata.data);
414 static bool api_DnssrvOperation2(struct pipes_struct *p)
416 const struct ndr_interface_call *call;
417 struct ndr_pull *pull;
418 struct ndr_push *push;
419 enum ndr_err_code ndr_err;
420 struct DnssrvOperation2 *r;
422 call = &ndr_table_dnsserver.calls[NDR_DNSSRVOPERATION2];
424 r = talloc(talloc_tos(), struct DnssrvOperation2);
429 pull = ndr_pull_init_blob(&p->in_data.data, r);
435 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
437 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
439 ndr_err = call->ndr_pull(pull, NDR_IN, r);
440 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
445 if (DEBUGLEVEL >= 10) {
446 NDR_PRINT_FUNCTION_DEBUG(DnssrvOperation2, NDR_IN, r);
449 r->out.result = _DnssrvOperation2(p, r);
451 if (p->fault_state) {
453 /* Return true here, srv_pipe_hnd.c will take care */
457 if (DEBUGLEVEL >= 10) {
458 NDR_PRINT_FUNCTION_DEBUG(DnssrvOperation2, NDR_OUT | NDR_SET_VALUES, r);
461 push = ndr_push_init_ctx(r);
468 * carry over the pointer count to the reply in case we are
469 * using full pointer. See NDR specification for full pointers
471 push->ptr_count = pull->ptr_count;
473 ndr_err = call->ndr_push(push, NDR_OUT, r);
474 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
479 p->out_data.rdata = ndr_push_blob(push);
480 talloc_steal(p->mem_ctx, p->out_data.rdata.data);
487 static bool api_DnssrvQuery2(struct pipes_struct *p)
489 const struct ndr_interface_call *call;
490 struct ndr_pull *pull;
491 struct ndr_push *push;
492 enum ndr_err_code ndr_err;
493 struct DnssrvQuery2 *r;
495 call = &ndr_table_dnsserver.calls[NDR_DNSSRVQUERY2];
497 r = talloc(talloc_tos(), struct DnssrvQuery2);
502 pull = ndr_pull_init_blob(&p->in_data.data, r);
508 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
510 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
512 ndr_err = call->ndr_pull(pull, NDR_IN, r);
513 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
518 if (DEBUGLEVEL >= 10) {
519 NDR_PRINT_FUNCTION_DEBUG(DnssrvQuery2, NDR_IN, r);
523 r->out.pdwTypeId = talloc_zero(r, enum DNS_RPC_TYPEID);
524 if (r->out.pdwTypeId == NULL) {
529 r->out.ppData = talloc_zero(r, union DNSSRV_RPC_UNION);
530 if (r->out.ppData == NULL) {
535 r->out.result = _DnssrvQuery2(p, r);
537 if (p->fault_state) {
539 /* Return true here, srv_pipe_hnd.c will take care */
543 if (DEBUGLEVEL >= 10) {
544 NDR_PRINT_FUNCTION_DEBUG(DnssrvQuery2, NDR_OUT | NDR_SET_VALUES, r);
547 push = ndr_push_init_ctx(r);
554 * carry over the pointer count to the reply in case we are
555 * using full pointer. See NDR specification for full pointers
557 push->ptr_count = pull->ptr_count;
559 ndr_err = call->ndr_push(push, NDR_OUT, r);
560 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
565 p->out_data.rdata = ndr_push_blob(push);
566 talloc_steal(p->mem_ctx, p->out_data.rdata.data);
573 static bool api_DnssrvComplexOperation2(struct pipes_struct *p)
575 const struct ndr_interface_call *call;
576 struct ndr_pull *pull;
577 struct ndr_push *push;
578 enum ndr_err_code ndr_err;
579 struct DnssrvComplexOperation2 *r;
581 call = &ndr_table_dnsserver.calls[NDR_DNSSRVCOMPLEXOPERATION2];
583 r = talloc(talloc_tos(), struct DnssrvComplexOperation2);
588 pull = ndr_pull_init_blob(&p->in_data.data, r);
594 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
596 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
598 ndr_err = call->ndr_pull(pull, NDR_IN, r);
599 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
604 if (DEBUGLEVEL >= 10) {
605 NDR_PRINT_FUNCTION_DEBUG(DnssrvComplexOperation2, NDR_IN, r);
609 r->out.pdwTypeOut = talloc_zero(r, enum DNS_RPC_TYPEID);
610 if (r->out.pdwTypeOut == NULL) {
615 r->out.ppDataOut = talloc_zero(r, union DNSSRV_RPC_UNION);
616 if (r->out.ppDataOut == NULL) {
621 r->out.result = _DnssrvComplexOperation2(p, r);
623 if (p->fault_state) {
625 /* Return true here, srv_pipe_hnd.c will take care */
629 if (DEBUGLEVEL >= 10) {
630 NDR_PRINT_FUNCTION_DEBUG(DnssrvComplexOperation2, NDR_OUT | NDR_SET_VALUES, r);
633 push = ndr_push_init_ctx(r);
640 * carry over the pointer count to the reply in case we are
641 * using full pointer. See NDR specification for full pointers
643 push->ptr_count = pull->ptr_count;
645 ndr_err = call->ndr_push(push, NDR_OUT, r);
646 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
651 p->out_data.rdata = ndr_push_blob(push);
652 talloc_steal(p->mem_ctx, p->out_data.rdata.data);
659 static bool api_DnssrvEnumRecords2(struct pipes_struct *p)
661 const struct ndr_interface_call *call;
662 struct ndr_pull *pull;
663 struct ndr_push *push;
664 enum ndr_err_code ndr_err;
665 struct DnssrvEnumRecords2 *r;
667 call = &ndr_table_dnsserver.calls[NDR_DNSSRVENUMRECORDS2];
669 r = talloc(talloc_tos(), struct DnssrvEnumRecords2);
674 pull = ndr_pull_init_blob(&p->in_data.data, r);
680 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
682 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
684 ndr_err = call->ndr_pull(pull, NDR_IN, r);
685 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
690 if (DEBUGLEVEL >= 10) {
691 NDR_PRINT_FUNCTION_DEBUG(DnssrvEnumRecords2, NDR_IN, r);
695 r->out.pdwBufferLength = talloc_zero(r, uint32_t);
696 if (r->out.pdwBufferLength == NULL) {
701 r->out.pBuffer = talloc_zero(r, struct DNS_RPC_RECORDS_ARRAY *);
702 if (r->out.pBuffer == NULL) {
707 r->out.result = _DnssrvEnumRecords2(p, r);
709 if (p->fault_state) {
711 /* Return true here, srv_pipe_hnd.c will take care */
715 if (DEBUGLEVEL >= 10) {
716 NDR_PRINT_FUNCTION_DEBUG(DnssrvEnumRecords2, NDR_OUT | NDR_SET_VALUES, r);
719 push = ndr_push_init_ctx(r);
726 * carry over the pointer count to the reply in case we are
727 * using full pointer. See NDR specification for full pointers
729 push->ptr_count = pull->ptr_count;
731 ndr_err = call->ndr_push(push, NDR_OUT, r);
732 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
737 p->out_data.rdata = ndr_push_blob(push);
738 talloc_steal(p->mem_ctx, p->out_data.rdata.data);
745 static bool api_DnssrvUpdateRecord2(struct pipes_struct *p)
747 const struct ndr_interface_call *call;
748 struct ndr_pull *pull;
749 struct ndr_push *push;
750 enum ndr_err_code ndr_err;
751 struct DnssrvUpdateRecord2 *r;
753 call = &ndr_table_dnsserver.calls[NDR_DNSSRVUPDATERECORD2];
755 r = talloc(talloc_tos(), struct DnssrvUpdateRecord2);
760 pull = ndr_pull_init_blob(&p->in_data.data, r);
766 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
768 pull->flags |= LIBNDR_FLAG_BIGENDIAN;
770 ndr_err = call->ndr_pull(pull, NDR_IN, r);
771 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
776 if (DEBUGLEVEL >= 10) {
777 NDR_PRINT_FUNCTION_DEBUG(DnssrvUpdateRecord2, NDR_IN, r);
780 r->out.result = _DnssrvUpdateRecord2(p, r);
782 if (p->fault_state) {
784 /* Return true here, srv_pipe_hnd.c will take care */
788 if (DEBUGLEVEL >= 10) {
789 NDR_PRINT_FUNCTION_DEBUG(DnssrvUpdateRecord2, NDR_OUT | NDR_SET_VALUES, r);
792 push = ndr_push_init_ctx(r);
799 * carry over the pointer count to the reply in case we are
800 * using full pointer. See NDR specification for full pointers
802 push->ptr_count = pull->ptr_count;
804 ndr_err = call->ndr_push(push, NDR_OUT, r);
805 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
810 p->out_data.rdata = ndr_push_blob(push);
811 talloc_steal(p->mem_ctx, p->out_data.rdata.data);
820 static struct api_struct api_dnsserver_cmds[] =
822 {"DNSSRVOPERATION", NDR_DNSSRVOPERATION, api_DnssrvOperation},
823 {"DNSSRVQUERY", NDR_DNSSRVQUERY, api_DnssrvQuery},
824 {"DNSSRVCOMPLEXOPERATION", NDR_DNSSRVCOMPLEXOPERATION, api_DnssrvComplexOperation},
825 {"DNSSRVENUMRECORDS", NDR_DNSSRVENUMRECORDS, api_DnssrvEnumRecords},
826 {"DNSSRVUPDATERECORD", NDR_DNSSRVUPDATERECORD, api_DnssrvUpdateRecord},
827 {"DNSSRVOPERATION2", NDR_DNSSRVOPERATION2, api_DnssrvOperation2},
828 {"DNSSRVQUERY2", NDR_DNSSRVQUERY2, api_DnssrvQuery2},
829 {"DNSSRVCOMPLEXOPERATION2", NDR_DNSSRVCOMPLEXOPERATION2, api_DnssrvComplexOperation2},
830 {"DNSSRVENUMRECORDS2", NDR_DNSSRVENUMRECORDS2, api_DnssrvEnumRecords2},
831 {"DNSSRVUPDATERECORD2", NDR_DNSSRVUPDATERECORD2, api_DnssrvUpdateRecord2},
834 void dnsserver_get_pipe_fns(struct api_struct **fns, int *n_fns)
836 *fns = api_dnsserver_cmds;
837 *n_fns = sizeof(api_dnsserver_cmds) / sizeof(struct api_struct);
840 NTSTATUS rpc_dnsserver_init(const struct rpc_srv_callbacks *rpc_srv_cb)
842 return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "dnsserver", "dnsserver", &ndr_table_dnsserver, api_dnsserver_cmds, sizeof(api_dnsserver_cmds) / sizeof(struct api_struct), rpc_srv_cb);
845 NTSTATUS rpc_dnsserver_shutdown(void)
847 return rpc_srv_unregister(&ndr_table_dnsserver);