summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2010-08-12 14:49:47 +0200
committerStefan Metzmacher <metze@samba.org>2010-08-16 14:30:19 +0200
commit7f2343be122e80a426eeea29ed602fbc84bdc77b (patch)
treecb8817ad5c2d959e5fd175326eea9e4e944a7c5d
parent12379097abbab06f7a41bdcd00093f0c7ba08a8f (diff)
downloadsamba-7f2343be122e80a426eeea29ed602fbc84bdc77b.tar.gz
samba-7f2343be122e80a426eeea29ed602fbc84bdc77b.tar.bz2
samba-7f2343be122e80a426eeea29ed602fbc84bdc77b.zip
s3:winbindd: remove unused wb_ndr_dispatch* functions
metze
-rw-r--r--source3/winbindd/winbindd_dual_ndr.c165
1 files changed, 0 insertions, 165 deletions
diff --git a/source3/winbindd/winbindd_dual_ndr.c b/source3/winbindd/winbindd_dual_ndr.c
index 65387f9558..32fbf09a2c 100644
--- a/source3/winbindd/winbindd_dual_ndr.c
+++ b/source3/winbindd/winbindd_dual_ndr.c
@@ -36,168 +36,6 @@ struct wb_ndr_transport_priv {
struct winbindd_child *child;
};
-struct wb_ndr_dispatch_state {
- struct wb_ndr_transport_priv *transport;
- uint32_t opnum;
- const struct ndr_interface_call *call;
- void *r;
- DATA_BLOB req_blob, resp_blob;
- struct winbindd_request request;
- struct winbindd_response *response;
-};
-
-static void wb_ndr_dispatch_done(struct tevent_req *subreq);
-
-static struct tevent_req *wb_ndr_dispatch_send(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- struct rpc_pipe_client *cli,
- const struct ndr_interface_table *table,
- uint32_t opnum,
- void *r)
-{
- struct tevent_req *req, *subreq;
- struct wb_ndr_dispatch_state *state;
- struct wb_ndr_transport_priv *transport = talloc_get_type_abort(
- cli->transport->priv, struct wb_ndr_transport_priv);
- struct ndr_push *push;
- enum ndr_err_code ndr_err;
-
- req = tevent_req_create(mem_ctx, &state,
- struct wb_ndr_dispatch_state);
- if (req == NULL) {
- return NULL;
- }
-
- state->r = r;
- state->call = &table->calls[opnum];
- state->transport = transport;
- state->opnum = opnum;
-
- push = ndr_push_init_ctx(state);
- if (tevent_req_nomem(push, req)) {
- return tevent_req_post(req, ev);
- }
-
- ndr_err = state->call->ndr_push(push, NDR_IN, r);
- if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
- tevent_req_nterror(req, ndr_map_error2ntstatus(ndr_err));
- TALLOC_FREE(push);
- return tevent_req_post(req, ev);
- }
-
- state->req_blob = ndr_push_blob(push);
-
- if ((transport->domain != NULL)
- && wcache_fetch_ndr(state, transport->domain, opnum,
- &state->req_blob, &state->resp_blob)) {
- tevent_req_done(req);
- return tevent_req_post(req, ev);
- }
-
- state->request.cmd = WINBINDD_DUAL_NDRCMD;
- state->request.data.ndrcmd = opnum;
- state->request.extra_data.data = (char *)state->req_blob.data;
- state->request.extra_len = state->req_blob.length;
-
- subreq = wb_child_request_send(state, ev, transport->child,
- &state->request);
- if (tevent_req_nomem(subreq, req)) {
- return tevent_req_post(req, ev);
- }
- tevent_req_set_callback(subreq, wb_ndr_dispatch_done, req);
- return req;
-}
-
-static void wb_ndr_dispatch_done(struct tevent_req *subreq)
-{
- struct tevent_req *req = tevent_req_callback_data(
- subreq, struct tevent_req);
- struct wb_ndr_dispatch_state *state = tevent_req_data(
- req, struct wb_ndr_dispatch_state);
- int ret, err;
-
- ret = wb_child_request_recv(subreq, state, &state->response, &err);
- TALLOC_FREE(subreq);
- if (ret == -1) {
- tevent_req_nterror(req, map_nt_error_from_unix(err));
- return;
- }
-
- state->resp_blob = data_blob_const(
- state->response->extra_data.data,
- state->response->length - sizeof(struct winbindd_response));
-
- if (state->transport->domain != NULL) {
- wcache_store_ndr(state->transport->domain, state->opnum,
- &state->req_blob, &state->resp_blob);
- }
-
- tevent_req_done(req);
-}
-
-static NTSTATUS wb_ndr_dispatch_recv(struct tevent_req *req,
- TALLOC_CTX *mem_ctx)
-{
- struct wb_ndr_dispatch_state *state = tevent_req_data(
- req, struct wb_ndr_dispatch_state);
- NTSTATUS status;
- struct ndr_pull *pull;
- enum ndr_err_code ndr_err;
-
- if (tevent_req_is_nterror(req, &status)) {
- return status;
- }
-
- pull = ndr_pull_init_blob(&state->resp_blob, 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 = state->call->ndr_pull(pull, NDR_OUT, state->r);
- TALLOC_FREE(pull);
-
- if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
- return ndr_map_error2ntstatus(ndr_err);
- }
-
- return NT_STATUS_OK;
-}
-
-static NTSTATUS wb_ndr_dispatch(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx,
- const struct ndr_interface_table *table,
- uint32_t opnum, void *r)
-{
- TALLOC_CTX *frame = talloc_stackframe();
- struct event_context *ev;
- struct tevent_req *req;
- NTSTATUS status = NT_STATUS_OK;
-
- ev = event_context_init(frame);
- if (ev == NULL) {
- status = NT_STATUS_NO_MEMORY;
- goto fail;
- }
-
- req = wb_ndr_dispatch_send(frame, ev, cli, table, opnum, r);
- if (req == NULL) {
- status = NT_STATUS_NO_MEMORY;
- goto fail;
- }
-
- if (!tevent_req_poll(req, ev)) {
- status = map_nt_error_from_unix(errno);
- goto fail;
- }
-
- status = wb_ndr_dispatch_recv(req, mem_ctx);
- fail:
- TALLOC_FREE(frame);
- return status;
-}
-
struct wbint_bh_state {
struct rpc_pipe_client *rpc_cli;
};
@@ -466,9 +304,6 @@ struct rpc_pipe_client *wbint_rpccli_create(TALLOC_CTX *mem_ctx,
}
result->abstract_syntax = ndr_table_wbint.syntax_id;
result->transfer_syntax = ndr_transfer_syntax;
- result->dispatch = wb_ndr_dispatch;
- result->dispatch_send = wb_ndr_dispatch_send;
- result->dispatch_recv = wb_ndr_dispatch_recv;
result->max_xmit_frag = RPC_MAX_PDU_FRAG_LEN;
result->max_recv_frag = RPC_MAX_PDU_FRAG_LEN;
result->desthost = NULL;