From 6173d36340096fc3e188e6cc886c345981e0f303 Mon Sep 17 00:00:00 2001 From: George Kadianakis Date: Wed, 25 Jan 2012 18:51:38 +0200 Subject: Move transport-related functions from circuitbuild.c to transports.c. Move 'transport_t' to transports.h, and all transport-related functions that don't rely on 'bridge_list' to transports.c. --- src/or/transports.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/or/transports.h') diff --git a/src/or/transports.h b/src/or/transports.h index 02f159a5d6..f00c7c0938 100644 --- a/src/or/transports.h +++ b/src/or/transports.h @@ -11,6 +11,33 @@ #ifndef TOR_TRANSPORTS_H #define TOR_TRANSPORTS_H +/** Represents a pluggable transport used by a bridge. */ +typedef struct { + /** SOCKS version: One of PROXY_SOCKS4, PROXY_SOCKS5. */ + int socks_version; + /** Name of pluggable transport protocol */ + char *name; + /** Address of proxy */ + tor_addr_t addr; + /** Port of proxy */ + uint16_t port; + /** Boolean: We are re-parsing our transport list, and we are going to remove + * this one if we don't find it in the list of configured transports. */ + unsigned marked_for_removal : 1; +} transport_t; + +void mark_transport_list(void); +void sweep_transport_list(void); +void clear_transport_list(void); +int transport_add_from_config(const tor_addr_t *addr, uint16_t port, + const char *name, int socks_ver); +int transport_add(transport_t *t); +void transport_free(transport_t *transport); +transport_t *transport_new(const tor_addr_t *addr, uint16_t port, + const char *name, int socks_ver); +transport_t *transport_get_by_name(const char *name); + + void pt_kickstart_proxy(const smartlist_t *transport_list, char **proxy_argv, int is_server); -- cgit v1.2.3-54-g00ecf