diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2004-11-07 19:28:18 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:05:38 -0500 |
commit | add049380ea964a430c60e668e4dffd7ed81156e (patch) | |
tree | b6bbfe986251fc497324e50ab986815c44289191 | |
parent | 485df40bf96abbd80d69ff2a9fdca86516a4eae7 (diff) | |
download | samba-add049380ea964a430c60e668e4dffd7ed81156e.tar.gz samba-add049380ea964a430c60e668e4dffd7ed81156e.tar.bz2 samba-add049380ea964a430c60e668e4dffd7ed81156e.zip |
r3602: Add looking up transport by endpoint protocol
(This used to be commit 76c02ecbe8581fbf07bb59dd22ba88eb97b4fd04)
-rw-r--r-- | source4/librpc/rpc/dcerpc_util.c | 16 |
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; |