summaryrefslogtreecommitdiff
path: root/source3/librpc/gen_ndr/srv_wbint.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-07-28 15:06:11 -0400
committerVolker Lendecke <vl@samba.org>2009-08-05 03:21:19 -0400
commit6cf3db91499ebd245b08997a319edf36cfee3365 (patch)
treea7355f3e0b25e2a13964b7500c77980e94cf2373 /source3/librpc/gen_ndr/srv_wbint.c
parentddd13c6816e7d289406948fe2f68db1aba7669d3 (diff)
downloadsamba-6cf3db91499ebd245b08997a319edf36cfee3365.tar.gz
samba-6cf3db91499ebd245b08997a319edf36cfee3365.tar.bz2
samba-6cf3db91499ebd245b08997a319edf36cfee3365.zip
s3:winbind: Add NDR-based parent-child communication to winbind
Diffstat (limited to 'source3/librpc/gen_ndr/srv_wbint.c')
-rw-r--r--source3/librpc/gen_ndr/srv_wbint.c130
1 files changed, 130 insertions, 0 deletions
diff --git a/source3/librpc/gen_ndr/srv_wbint.c b/source3/librpc/gen_ndr/srv_wbint.c
new file mode 100644
index 0000000000..0a3569b874
--- /dev/null
+++ b/source3/librpc/gen_ndr/srv_wbint.c
@@ -0,0 +1,130 @@
+/*
+ * Unix SMB/CIFS implementation.
+ * server auto-generated by pidl. DO NOT MODIFY!
+ */
+
+#include "includes.h"
+#include "librpc/gen_ndr/srv_wbint.h"
+
+static bool api_wbint_Ping(pipes_struct *p)
+{
+ const struct ndr_interface_call *call;
+ struct ndr_pull *pull;
+ struct ndr_push *push;
+ enum ndr_err_code ndr_err;
+ DATA_BLOB blob;
+ struct wbint_Ping *r;
+
+ call = &ndr_table_wbint.calls[NDR_WBINT_PING];
+
+ r = talloc(talloc_tos(), struct wbint_Ping);
+ if (r == NULL) {
+ return false;
+ }
+
+ if (!prs_data_blob(&p->in_data.data, &blob, r)) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull = ndr_pull_init_blob(&blob, r, NULL);
+ if (pull == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ ndr_err = call->ndr_pull(pull, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(wbint_Ping, r);
+ }
+
+ ZERO_STRUCT(r->out);
+ r->out.out_data = talloc_zero(r, uint32_t);
+ if (r->out.out_data == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ _wbint_Ping(p, r);
+
+ if (p->rng_fault_state) {
+ talloc_free(r);
+ /* Return true here, srv_pipe_hnd.c will take care */
+ return true;
+ }
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(wbint_Ping, r);
+ }
+
+ push = ndr_push_init_ctx(r, NULL);
+ if (push == NULL) {
+ talloc_free(r);
+ return false;
+ }
+
+ ndr_err = call->ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ talloc_free(r);
+ return false;
+ }
+
+ blob = ndr_push_blob(push);
+ if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
+ talloc_free(r);
+ return false;
+ }
+
+ talloc_free(r);
+
+ return true;
+}
+
+
+/* Tables */
+static struct api_struct api_wbint_cmds[] =
+{
+ {"WBINT_PING", NDR_WBINT_PING, api_wbint_Ping},
+};
+
+void wbint_get_pipe_fns(struct api_struct **fns, int *n_fns)
+{
+ *fns = api_wbint_cmds;
+ *n_fns = sizeof(api_wbint_cmds) / sizeof(struct api_struct);
+}
+
+NTSTATUS rpc_wbint_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const struct ndr_interface_table *table, uint32_t opnum, void *_r)
+{
+ if (cli->pipes_struct == NULL) {
+ return NT_STATUS_INVALID_PARAMETER;
+ }
+
+ switch (opnum)
+ {
+ case NDR_WBINT_PING: {
+ struct wbint_Ping *r = (struct wbint_Ping *)_r;
+ ZERO_STRUCT(r->out);
+ r->out.out_data = talloc_zero(mem_ctx, uint32_t);
+ if (r->out.out_data == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
+
+ _wbint_Ping(cli->pipes_struct, r);
+ return NT_STATUS_OK;
+ }
+
+ default:
+ return NT_STATUS_NOT_IMPLEMENTED;
+ }
+}
+
+NTSTATUS rpc_wbint_init(void)
+{
+ return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "wbint", "wbint", &ndr_table_wbint, api_wbint_cmds, sizeof(api_wbint_cmds) / sizeof(struct api_struct));
+}