diff options
Diffstat (limited to 'src/or/circuitbuild.c')
-rw-r--r-- | src/or/circuitbuild.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index 403f65f284..82ff327135 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -4972,6 +4972,21 @@ find_bridge_by_digest(const char *digest) return NULL; } +const char * +find_transport_name_by_bridge_addrport(const tor_addr_t *addr, uint16_t port) +{ + if (!bridge_list) + return NULL; + + SMARTLIST_FOREACH_BEGIN(bridge_list, const bridge_info_t *, bridge) { + if (tor_addr_eq(&bridge->addr, addr) && + (bridge->port == port)) + return bridge->transport_name; + } SMARTLIST_FOREACH_END(bridge); + + return NULL; +} + /** If <b>addr</b> and <b>port</b> match the address and port of a * bridge of ours that uses pluggable transports, place its transport * in <b>transport</b>. |