From 4b751b29e50ea87bd3f082d63014cbcbff8bc519 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 13 Jul 2011 13:49:57 +0200 Subject: [PATCH] s3-librpc: Remove obsolete dcerpc_binding_vector_create(). --- source3/librpc/rpc/dcerpc_ep.c | 105 --------------------------------- source3/librpc/rpc/dcerpc_ep.h | 6 -- 2 files changed, 111 deletions(-) diff --git a/source3/librpc/rpc/dcerpc_ep.c b/source3/librpc/rpc/dcerpc_ep.c index e734be3b2b..336ff878e1 100644 --- a/source3/librpc/rpc/dcerpc_ep.c +++ b/source3/librpc/rpc/dcerpc_ep.c @@ -291,111 +291,6 @@ struct dcerpc_binding_vector *dcerpc_binding_vector_dup(TALLOC_CTX *mem_ctx, return v; } -NTSTATUS dcerpc_binding_vector_create(TALLOC_CTX *mem_ctx, - const struct ndr_interface_table *iface, - uint16_t port, - const char *ncalrpc, - struct dcerpc_binding_vector **pbvec) -{ - struct dcerpc_binding_vector *bvec; - uint32_t ep_count; - uint32_t count = 0; - uint32_t i; - NTSTATUS status; - TALLOC_CTX *tmp_ctx; - - tmp_ctx = talloc_stackframe(); - if (tmp_ctx == NULL) { - return NT_STATUS_NO_MEMORY; - } - - ep_count = iface->endpoints->count; - - bvec = talloc_zero(tmp_ctx, struct dcerpc_binding_vector); - if (bvec == NULL) { - status = NT_STATUS_NO_MEMORY; - goto done; - } - - bvec->bindings = talloc_zero_array(bvec, struct dcerpc_binding, ep_count); - if (bvec->bindings == NULL) { - status = NT_STATUS_NO_MEMORY; - goto done; - } - - for (i = 0; i < ep_count; i++) { - struct dcerpc_binding *b; - - b = talloc_zero(bvec->bindings, struct dcerpc_binding); - if (b == NULL) { - status = NT_STATUS_NO_MEMORY; - goto done; - } - - status = dcerpc_parse_binding(b, iface->endpoints->names[i], &b); - if (!NT_STATUS_IS_OK(status)) { - status = NT_STATUS_UNSUCCESSFUL; - goto done; - } - - b->object = iface->syntax_id; - - switch (b->transport) { - case NCACN_NP: - b->host = talloc_asprintf(b, "\\\\%s", lp_netbios_name()); - if (b->host == NULL) { - status = NT_STATUS_NO_MEMORY; - goto done; - } - break; - case NCACN_IP_TCP: - if (port == 0) { - talloc_free(b); - continue; - } - - b->endpoint = talloc_asprintf(b, "%u", port); - if (b->endpoint == NULL) { - status = NT_STATUS_NO_MEMORY; - goto done; - } - - break; - case NCALRPC: - if (ncalrpc == NULL) { - talloc_free(b); - continue; - } - - b->endpoint = talloc_asprintf(b, - "%s/%s", - lp_ncalrpc_dir(), - ncalrpc); - if (b->endpoint == NULL) { - status = NT_STATUS_NO_MEMORY; - goto done; - } - break; - default: - talloc_free(b); - continue; - } - - bvec->bindings[count] = *b; - count++; - } - - bvec->count = count; - - *pbvec = talloc_move(mem_ctx, &bvec); - - status = NT_STATUS_OK; -done: - talloc_free(tmp_ctx); - - return status; -} - static NTSTATUS ep_register(TALLOC_CTX *mem_ctx, struct messaging_context *msg_ctx, const struct ndr_interface_table *iface, diff --git a/source3/librpc/rpc/dcerpc_ep.h b/source3/librpc/rpc/dcerpc_ep.h index ba1e688e6c..8bcf184280 100644 --- a/source3/librpc/rpc/dcerpc_ep.h +++ b/source3/librpc/rpc/dcerpc_ep.h @@ -107,12 +107,6 @@ struct dcerpc_binding_vector *dcerpc_binding_vector_dup(TALLOC_CTX *mem_ctx, NTSTATUS dcerpc_binding_vector_replace_iface(const struct ndr_interface_table *iface, struct dcerpc_binding_vector *v); -NTSTATUS dcerpc_binding_vector_create(TALLOC_CTX *mem_ctx, - const struct ndr_interface_table *iface, - uint16_t port, - const char *ncalrpc, - struct dcerpc_binding_vector **pbvec); - /** * @brief Adds server address information in the local endpoint map. * -- 2.34.1