summaryrefslogtreecommitdiff
path: root/source4/librpc/rpc/dcerpc_util.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2004-11-07 19:28:18 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:05:38 -0500
commitadd049380ea964a430c60e668e4dffd7ed81156e (patch)
treeb6bbfe986251fc497324e50ab986815c44289191 /source4/librpc/rpc/dcerpc_util.c
parent485df40bf96abbd80d69ff2a9fdca86516a4eae7 (diff)
downloadsamba-add049380ea964a430c60e668e4dffd7ed81156e.tar.gz
samba-add049380ea964a430c60e668e4dffd7ed81156e.tar.bz2
samba-add049380ea964a430c60e668e4dffd7ed81156e.zip
r3602: Add looking up transport by endpoint protocol
(This used to be commit 76c02ecbe8581fbf07bb59dd22ba88eb97b4fd04)
Diffstat (limited to 'source4/librpc/rpc/dcerpc_util.c')
-rw-r--r--source4/librpc/rpc/dcerpc_util.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/source4/librpc/rpc/dcerpc_util.c b/source4/librpc/rpc/dcerpc_util.c
index 45345325b0..69dae46aef 100644
--- a/source4/librpc/rpc/dcerpc_util.c
+++ b/source4/librpc/rpc/dcerpc_util.c
@@ -517,6 +517,22 @@ static NTSTATUS dcerpc_floor_set_rhs_data(TALLOC_CTX *mem_ctx, struct epm_floor
return NT_STATUS_NOT_SUPPORTED;
}
+enum dcerpc_transport_t dcerpc_transport_by_endpoint_protocol(int prot)
+{
+ int i;
+
+ /* Find a transport that has 'prot' as 4th protocol */
+ for (i=0;i<ARRAY_SIZE(transports);i++) {
+ if (transports[i].num_protocols >= 2 &&
+ transports[i].protseq[1] == prot) {
+ return transports[i].transport;
+ }
+ }
+
+ /* Unknown transport */
+ return -1;
+}
+
enum dcerpc_transport_t dcerpc_transport_by_tower(struct epm_tower *tower)
{
int i;