summaryrefslogtreecommitdiff
path: root/librpc
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-01-09 18:32:20 +0100
committerVolker Lendecke <vl@samba.org>2009-01-09 23:08:16 +0100
commitf8f878285d348e43a22385c1907dff3e120d4b59 (patch)
treea24c17881abc2eed03885908b2ad29c77402fb71 /librpc
parentad6e9c60124ed30ee035cd522db3c4e561e4543a (diff)
downloadsamba-f8f878285d348e43a22385c1907dff3e120d4b59.tar.gz
samba-f8f878285d348e43a22385c1907dff3e120d4b59.tar.bz2
samba-f8f878285d348e43a22385c1907dff3e120d4b59.zip
Add derpc_transport_string_by_transport(), apply some const
Diffstat (limited to 'librpc')
-rw-r--r--librpc/rpc/binding.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/librpc/rpc/binding.c b/librpc/rpc/binding.c
index dff2426b48..ba992399cd 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;i<ARRAY_SIZE(transports);i++) {
- if (transports[i].transport == b->transport) {
- 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<ARRAY_SIZE(transports); i++) {
+ if (t == transports[i].transport) {
+ return transports[i].name;
+ }
+ }
+ return NULL;
+}
+
_PUBLIC_ NTSTATUS dcerpc_binding_from_tower(TALLOC_CTX *mem_ctx,
struct epm_tower *tower,
struct dcerpc_binding **b_out)