From 11a25f90500b64f4b43907f6f311dc5e9731da39 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 21 Jan 2009 14:05:51 +0100 Subject: Allow calling DCE/RPC server implementations directly using rpc_pipe_client. --- librpc/gen_ndr/srv_initshutdown.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'librpc/gen_ndr/srv_initshutdown.c') diff --git a/librpc/gen_ndr/srv_initshutdown.c b/librpc/gen_ndr/srv_initshutdown.c index f0f3a7ba73..247d83fb03 100644 --- a/librpc/gen_ndr/srv_initshutdown.c +++ b/librpc/gen_ndr/srv_initshutdown.c @@ -240,6 +240,37 @@ void initshutdown_get_pipe_fns(struct api_struct **fns, int *n_fns) *n_fns = sizeof(api_initshutdown_cmds) / sizeof(struct api_struct); } +NTSTATUS rpc_initshutdown_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_INITSHUTDOWN_INIT: { + struct initshutdown_Init *r = _r; + r->out.result = _initshutdown_Init(cli->pipes_struct, r); + return NT_STATUS_OK; + } + + case NDR_INITSHUTDOWN_ABORT: { + struct initshutdown_Abort *r = _r; + r->out.result = _initshutdown_Abort(cli->pipes_struct, r); + return NT_STATUS_OK; + } + + case NDR_INITSHUTDOWN_INITEX: { + struct initshutdown_InitEx *r = _r; + r->out.result = _initshutdown_InitEx(cli->pipes_struct, r); + return NT_STATUS_OK; + } + + default: + return NT_STATUS_NOT_IMPLEMENTED; + } +} + NTSTATUS rpc_initshutdown_init(void) { return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "initshutdown", "initshutdown", &ndr_table_initshutdown, api_initshutdown_cmds, sizeof(api_initshutdown_cmds) / sizeof(struct api_struct)); -- cgit