aboutsummaryrefslogtreecommitdiff
path: root/src/or/bridges.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-11-15 07:49:06 -0500
committerNick Mathewson <nickm@torproject.org>2016-11-30 14:42:52 -0500
commit8da24c99bdb90b04a05d5bccf5bcff1218174b75 (patch)
tree0c6accc0fbdca342fe336d8e10c10206b09f24a1 /src/or/bridges.h
parentdd6def5daf5b0b579a61c9e83cfa905b333f99a1 (diff)
downloadtor-8da24c99bdb90b04a05d5bccf5bcff1218174b75.tar.gz
tor-8da24c99bdb90b04a05d5bccf5bcff1218174b75.zip
Split bridge functions into a new module.
This patch is just: * Code movement * Adding headers here and there as needed * Adding a bridges_free_all() with a call to it. It breaks compilation, since the bridge code needed to make exactly 2 calls into entrynodes.c internals. I'll fix those in the next commit.
Diffstat (limited to 'src/or/bridges.h')
-rw-r--r--src/or/bridges.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/or/bridges.h b/src/or/bridges.h
new file mode 100644
index 0000000000..738b1a68ee
--- /dev/null
+++ b/src/or/bridges.h
@@ -0,0 +1,54 @@
+/* Copyright (c) 2001 Matej Pfajfar.
+ * Copyright (c) 2001-2004, Roger Dingledine.
+ * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
+ * Copyright (c) 2007-2016, The Tor Project, Inc. */
+/* See LICENSE for licensing information */
+
+/**
+ * \file bridges.h
+ * \brief Header file for circuitbuild.c.
+ **/
+
+#ifndef TOR_BRIDGES_H
+#define TOR_BRIDGES_H
+
+struct bridge_line_t;
+
+void mark_bridge_list(void);
+void sweep_bridge_list(void);
+
+int addr_is_a_configured_bridge(const tor_addr_t *addr, uint16_t port,
+ const char *digest);
+int extend_info_is_a_configured_bridge(const extend_info_t *ei);
+int routerinfo_is_a_configured_bridge(const routerinfo_t *ri);
+int node_is_a_configured_bridge(const node_t *node);
+void learned_router_identity(const tor_addr_t *addr, uint16_t port,
+ const char *digest);
+
+void bridge_add_from_config(struct bridge_line_t *bridge_line);
+void retry_bridge_descriptor_fetch_directly(const char *digest);
+void fetch_bridge_descriptors(const or_options_t *options, time_t now);
+void learned_bridge_descriptor(routerinfo_t *ri, int from_cache);
+int any_bridge_descriptors_known(void);
+const smartlist_t *get_socks_args_by_bridge_addrport(const tor_addr_t *addr,
+ uint16_t port);
+
+int any_bridges_dont_support_microdescriptors(void);
+
+const char *find_transport_name_by_bridge_addrport(const tor_addr_t *addr,
+ uint16_t port);
+struct transport_t;
+int get_transport_by_bridge_addrport(const tor_addr_t *addr, uint16_t port,
+ const struct transport_t **transport);
+
+MOCK_DECL(int, transport_is_needed, (const char *transport_name));
+int validate_pluggable_transports_config(void);
+
+MOCK_DECL(smartlist_t *, list_bridge_identities, (void));
+MOCK_DECL(download_status_t *, get_bridge_dl_status_by_id,
+ (const char *digest));
+
+void bridges_free_all(void);
+
+#endif
+