summaryrefslogtreecommitdiff
path: root/src/or/circuitbuild.c
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@gmail.com>2011-06-12 00:14:11 +0200
committerGeorge Kadianakis <desnacked@gmail.com>2011-06-12 00:14:11 +0200
commit29203b7f3f6d07dec1cede65f118aa450ac7712d (patch)
tree887c3c9c8f6ac739c06a33474d1ebad667eec2b7 /src/or/circuitbuild.c
parente09f302589dc3e46edccf366595392f2dd9b43e3 (diff)
downloadtor-29203b7f3f6d07dec1cede65f118aa450ac7712d.tar.gz
tor-29203b7f3f6d07dec1cede65f118aa450ac7712d.zip
We can now connect using transports as well!
Diffstat (limited to 'src/or/circuitbuild.c')
-rw-r--r--src/or/circuitbuild.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index c07e890c07..21018dcc71 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -100,6 +100,7 @@ static int count_acceptable_nodes(smartlist_t *routers);
static int onion_append_hop(crypt_path_t **head_ptr, extend_info_t *choice);
static void entry_guards_changed(void);
+static void transport_free(transport_info_t *transport);
/**
* This function decides if CBT learning should be disabled. It returns
@@ -4803,6 +4804,26 @@ find_bridge_by_digest(const char *digest)
return NULL;
}
+/** If <b>addr</b> and <b>port</b> match one of our known bridges,
+ * returns it's transport protocol if it has one, else returns NULL.
+ */
+transport_info_t *
+find_bridge_transport_by_addrport(const tor_addr_t *addr, uint16_t port)
+{
+ SMARTLIST_FOREACH_BEGIN(bridge_list, bridge_info_t *, bridge)
+ {
+ if (tor_addr_eq(&bridge->addr, addr) &&
+ (bridge->port == port)) {
+ if (bridge->transport) {
+ log_debug(LD_GENERAL, "Found matching bridge!\n");
+ return bridge->transport;
+ } else /* bridge found, but it had no transport */
+ return NULL;
+ }
+ } SMARTLIST_FOREACH_END(bridge);
+ return NULL;
+}
+
/** We need to ask <b>bridge</b> for its server descriptor. */
static void
launch_direct_bridge_descriptor_fetch(bridge_info_t *bridge)