From f8f878285d348e43a22385c1907dff3e120d4b59 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 9 Jan 2009 18:32:20 +0100 Subject: Add derpc_transport_string_by_transport(), apply some const --- librpc/rpc/binding.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'librpc/rpc') diff --git a/librpc/rpc/binding.c b/librpc/rpc/binding.c index dff2426b487..ba992399cda 100644 --- a/librpc/rpc/binding.c +++ b/librpc/rpc/binding.c @@ -176,11 +176,7 @@ _PUBLIC_ char *dcerpc_binding_string(TALLOC_CTX *mem_ctx, const struct dcerpc_bi const char *t_name = NULL; if (b->transport != NCA_UNKNOWN) { - for (i=0;itransport) { - t_name = transports[i].name; - } - } + t_name = derpc_transport_string_by_transport(b->transport); if (!t_name) { return NULL; } @@ -572,7 +568,7 @@ enum dcerpc_transport_t dcerpc_transport_by_endpoint_protocol(int prot) return (unsigned int)-1; } -_PUBLIC_ enum dcerpc_transport_t dcerpc_transport_by_tower(struct epm_tower *tower) +_PUBLIC_ enum dcerpc_transport_t dcerpc_transport_by_tower(const struct epm_tower *tower) { int i; @@ -598,6 +594,18 @@ _PUBLIC_ enum dcerpc_transport_t dcerpc_transport_by_tower(struct epm_tower *tow return (unsigned int)-1; } +_PUBLIC_ const char *derpc_transport_string_by_transport(enum dcerpc_transport_t t) +{ + int i; + + for (i=0; i