diff options
author | Stefan Metzmacher <metze@samba.org> | 2010-08-12 14:48:27 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2010-08-16 14:30:18 +0200 |
commit | 12379097abbab06f7a41bdcd00093f0c7ba08a8f (patch) | |
tree | 4224d6b66a76013f04b06ea4bd88ae3ccbca9f7d | |
parent | 745f63fd1ead248d5a7cd257c0cb38af3ed9dd8b (diff) | |
download | samba-12379097abbab06f7a41bdcd00093f0c7ba08a8f.tar.gz samba-12379097abbab06f7a41bdcd00093f0c7ba08a8f.tar.bz2 samba-12379097abbab06f7a41bdcd00093f0c7ba08a8f.zip |
s3:rpc_server: remove unused rpc_pipe_internal_dispatch()
metze
-rw-r--r-- | source3/rpc_server/rpc_ncacn_np_internal.c | 145 |
1 files changed, 0 insertions, 145 deletions
diff --git a/source3/rpc_server/rpc_ncacn_np_internal.c b/source3/rpc_server/rpc_ncacn_np_internal.c index 58727600cf..71a14be845 100644 --- a/source3/rpc_server/rpc_ncacn_np_internal.c +++ b/source3/rpc_server/rpc_ncacn_np_internal.c @@ -171,150 +171,6 @@ struct pipes_struct *make_internal_rpc_pipe_p(TALLOC_CTX *mem_ctx, return p; } -/**************************************************************************** -****************************************************************************/ - -static NTSTATUS internal_ndr_push(TALLOC_CTX *mem_ctx, - struct rpc_pipe_client *cli, - const struct ndr_interface_table *table, - uint32_t opnum, - void *r) -{ - const struct ndr_interface_call *call; - struct ndr_push *push; - enum ndr_err_code ndr_err; - - if (!ndr_syntax_id_equal(&table->syntax_id, &cli->abstract_syntax) || - (opnum >= table->num_calls)) { - return NT_STATUS_INVALID_PARAMETER; - } - - call = &table->calls[opnum]; - - if (DEBUGLEVEL >= 10) { - ndr_print_function_debug(call->ndr_print, - call->name, NDR_IN, r); - } - - push = ndr_push_init_ctx(mem_ctx); - if (push == NULL) { - return NT_STATUS_NO_MEMORY; - } - - ndr_err = call->ndr_push(push, NDR_IN, r); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - TALLOC_FREE(push); - return ndr_map_error2ntstatus(ndr_err); - } - - cli->pipes_struct->in_data.data = ndr_push_blob(push); - talloc_steal(cli->pipes_struct->mem_ctx, - cli->pipes_struct->in_data.data.data); - TALLOC_FREE(push); - - return NT_STATUS_OK; -} - -/**************************************************************************** -****************************************************************************/ - -static NTSTATUS internal_ndr_pull(TALLOC_CTX *mem_ctx, - struct rpc_pipe_client *cli, - const struct ndr_interface_table *table, - uint32_t opnum, - void *r) -{ - const struct ndr_interface_call *call; - struct ndr_pull *pull; - enum ndr_err_code ndr_err; - - if (!ndr_syntax_id_equal(&table->syntax_id, &cli->abstract_syntax) || - (opnum >= table->num_calls)) { - return NT_STATUS_INVALID_PARAMETER; - } - - call = &table->calls[opnum]; - - pull = ndr_pull_init_blob(&cli->pipes_struct->out_data.rdata, - mem_ctx); - if (pull == NULL) { - return NT_STATUS_NO_MEMORY; - } - - /* have the ndr parser alloc memory for us */ - pull->flags |= LIBNDR_FLAG_REF_ALLOC; - ndr_err = call->ndr_pull(pull, NDR_OUT, r); - TALLOC_FREE(pull); - - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - return ndr_map_error2ntstatus(ndr_err); - } - - if (DEBUGLEVEL >= 10) { - ndr_print_function_debug(call->ndr_print, - call->name, NDR_OUT, r); - } - - return NT_STATUS_OK; -} - -/**************************************************************************** -****************************************************************************/ - -static NTSTATUS rpc_pipe_internal_dispatch(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const struct ndr_interface_table *table, - uint32_t opnum, void *r) -{ - NTSTATUS status; - int num_cmds = rpc_srv_get_pipe_num_cmds(&table->syntax_id); - const struct api_struct *cmds = rpc_srv_get_pipe_cmds(&table->syntax_id); - int i; - - if (cli->pipes_struct == NULL) { - return NT_STATUS_INVALID_PARAMETER; - } - - /* set opnum */ - cli->pipes_struct->opnum = opnum; - - for (i = 0; i < num_cmds; i++) { - if (cmds[i].opnum == opnum && cmds[i].fn != NULL) { - break; - } - } - - if (i == num_cmds) { - return NT_STATUS_INVALID_PARAMETER; - } - - status = internal_ndr_push(mem_ctx, cli, table, opnum, r); - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - if (!cmds[i].fn(cli->pipes_struct)) { - data_blob_free(&cli->pipes_struct->in_data.data); - data_blob_free(&cli->pipes_struct->out_data.rdata); - talloc_free_children(cli->pipes_struct->mem_ctx); - return NT_STATUS_UNSUCCESSFUL; - } - - status = internal_ndr_pull(mem_ctx, cli, table, opnum, r); - if (!NT_STATUS_IS_OK(status)) { - data_blob_free(&cli->pipes_struct->in_data.data); - data_blob_free(&cli->pipes_struct->out_data.rdata); - talloc_free_children(cli->pipes_struct->mem_ctx); - return status; - } - - data_blob_free(&cli->pipes_struct->in_data.data); - data_blob_free(&cli->pipes_struct->out_data.rdata); - talloc_free_children(cli->pipes_struct->mem_ctx); - - return NT_STATUS_OK; -} - static NTSTATUS rpcint_dispatch(struct pipes_struct *p, TALLOC_CTX *mem_ctx, uint32_t opnum, @@ -625,7 +481,6 @@ NTSTATUS rpc_pipe_open_internal(TALLOC_CTX *mem_ctx, result->abstract_syntax = *abstract_syntax; result->transfer_syntax = ndr_transfer_syntax; - result->dispatch = rpc_pipe_internal_dispatch; result->pipes_struct = make_internal_rpc_pipe_p( result, abstract_syntax, "", serversupplied_info, msg_ctx); |