Tor 0.4.9.0-alpha-dev
|
Headers for transports.c. More...
#include "lib/process/process.h"
Go to the source code of this file.
Data Structures | |
struct | transport_t |
Macros | |
#define | transport_free(tr) FREE_AND_NULL(transport_t, transport_free_, (tr)) |
#define | pt_kickstart_client_proxy(tl, pa) pt_kickstart_proxy(tl, pa, 0) |
#define | pt_kickstart_server_proxy(tl, pa) pt_kickstart_proxy(tl, pa, 1) |
Functions | |
void | mark_transport_list (void) |
void | sweep_transport_list (void) |
int | transport_add_from_config (const tor_addr_t *addr, uint16_t port, const char *name, int socks_ver) |
void | transport_free_ (transport_t *transport) |
transport_t * | transport_get_by_name (const char *name) |
bool | managed_proxy_has_transport (const char *transport_name) |
void | pt_kickstart_proxy (const smartlist_t *transport_list, char **proxy_argv, int is_server) |
void | pt_configure_remaining_proxies (void) |
int | pt_proxies_configuration_pending (void) |
char * | pt_get_extra_info_descriptor_string (void) |
void | pt_free_all (void) |
void | pt_prepare_proxy_list_for_config_read (void) |
void | sweep_proxy_list (void) |
smartlist_t * | get_transport_proxy_ports (void) |
char * | pt_stringify_socks_args (const smartlist_t *socks_args) |
char * | pt_get_socks_args_for_proxy_addrport (const tor_addr_t *addr, uint16_t port) |
char * | tor_escape_str_for_pt_args (const char *string, const char *chars_to_escape) |
Headers for transports.c.
Definition in file transports.h.
#define pt_kickstart_client_proxy | ( | tl, | |
pa | |||
) | pt_kickstart_proxy(tl, pa, 0) |
Definition at line 50 of file transports.h.
#define pt_kickstart_server_proxy | ( | tl, | |
pa | |||
) | pt_kickstart_proxy(tl, pa, 1) |
Definition at line 52 of file transports.h.
#define transport_free | ( | tr | ) | FREE_AND_NULL(transport_t, transport_free_, (tr)) |
Definition at line 41 of file transports.h.
smartlist_t * get_transport_proxy_ports | ( | void | ) |
Return a smartlist containing the ports where our pluggable transports are listening.
XXX assume that external proxy ports have been forwarded manually
Definition at line 1712 of file transports.c.
bool managed_proxy_has_transport | ( | const char * | transport_name | ) |
Return true iff we have a managed_proxy_t in the global list is for the given transport name.
Definition at line 375 of file transports.c.
void mark_transport_list | ( | void | ) |
Mark every entry of the transport list to be removed on our next call to sweep_transport_list unless it has first been un-marked.
Definition at line 181 of file transports.c.
void pt_configure_remaining_proxies | ( | void | ) |
Check if any of the managed proxies we are currently trying to configure has anything new to say.
Definition at line 594 of file transports.c.
void pt_free_all | ( | void | ) |
Release all storage held by the pluggable transports subsystem.
Definition at line 1905 of file transports.c.
char * pt_get_extra_info_descriptor_string | ( | void | ) |
Return the pluggable transport string that we should display in our extra-info descriptor. If we shouldn't display such a string, or we have nothing to display, return NULL. The string is allocated on the heap and it's the responsibility of the caller to free it.
Definition at line 1742 of file transports.c.
Referenced by extrainfo_dump_to_string_stats_helper().
char * pt_get_socks_args_for_proxy_addrport | ( | const tor_addr_t * | addr, |
uint16_t | port | ||
) |
Return a string of the SOCKS arguments that we should pass to the pluggable transports proxy in addr:port according to 180_pluggable_transport.txt. The string is allocated on the heap and it's the responsibility of the caller to free it after use.
Definition at line 1873 of file transports.c.
void pt_kickstart_proxy | ( | const smartlist_t * | with_transport_list, |
char ** | proxy_argv, | ||
int | is_server | ||
) |
Register proxy with proxy_argv, supporting transports in transport_list, to the managed proxy subsystem. If is_server is true, then the proxy is a server proxy.
Takes ownership of proxy_argv.
Requires that proxy_argv be a NULL-terminated array of command-line elements, containing at least one element.
Definition at line 1619 of file transports.c.
void pt_prepare_proxy_list_for_config_read | ( | void | ) |
Tor will read its config. Prepare the managed proxy list so that proxies not used in the new config will shutdown, and proxies that need to spawn different transports will do so.
Definition at line 1679 of file transports.c.
int pt_proxies_configuration_pending | ( | void | ) |
Return true if there are still unconfigured managed proxies, or proxies that need restarting.
Definition at line 397 of file transports.c.
Referenced by fetch_bridge_descriptors().
char * pt_stringify_socks_args | ( | const smartlist_t * | socks_args | ) |
Stringify the SOCKS arguments in socks_args according to 180_pluggable_transport.txt. The string is allocated on the heap and it's the responsibility of the caller to free it after use.
Definition at line 1837 of file transports.c.
Referenced by pt_get_socks_args_for_proxy_addrport().
void sweep_proxy_list | ( | void | ) |
The tor config was read. Destroy all managed proxies that were marked by a previous call to prepare_proxy_list_for_config_read() and are not used by the new config.
Definition at line 1889 of file transports.c.
void sweep_transport_list | ( | void | ) |
Remove every entry of the transport list that was marked with mark_transport_list if it has not subsequently been un-marked.
Definition at line 192 of file transports.c.
char * tor_escape_str_for_pt_args | ( | const char * | string, |
const char * | chars_to_escape | ||
) |
Return a newly allocated string equal to string, except that every character in chars_to_escape is preceded by a backslash.
Definition at line 1931 of file transports.c.
Referenced by get_transport_options_for_server_proxy().
int transport_add_from_config | ( | const tor_addr_t * | addr, |
uint16_t | port, | ||
const char * | name, | ||
int | socks_ver | ||
) |
Remember a new pluggable transport proxy at addr:port. name is set to the name of the protocol this proxy uses. socks_ver is set to the SOCKS version of the proxy.
Definition at line 340 of file transports.c.
void transport_free_ | ( | transport_t * | transport | ) |
Free the pluggable transport struct transport.
Definition at line 168 of file transports.c.
transport_t * transport_get_by_name | ( | const char * | name | ) |
Returns the transport in our transport list that has the name name. Else returns NULL.
Definition at line 237 of file transports.c.
Referenced by bridge_has_invalid_transport(), get_transport_by_bridge_addrport(), proxy_prepare_for_restart(), pt_kickstart_proxy(), and transport_resolve_conflicts().