Tor  0.4.3.0-alpha-dev
Data Structures | Macros | Functions
transports.h File Reference

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_ttransport_get_by_name (const char *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_tget_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)
 

Detailed Description

Headers for transports.c.

Definition in file transports.h.

Function Documentation

◆ get_transport_proxy_ports()

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 1591 of file transports.c.

◆ mark_transport_list()

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 179 of file transports.c.

◆ pt_configure_remaining_proxies()

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 566 of file transports.c.

◆ pt_free_all()

void pt_free_all ( void  )

Release all storage held by the pluggable transports subsystem.

Definition at line 1756 of file transports.c.

◆ pt_get_extra_info_descriptor_string()

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 1621 of file transports.c.

Referenced by extrainfo_dump_to_string_stats_helper().

◆ pt_get_socks_args_for_proxy_addrport()

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 1724 of file transports.c.

◆ pt_kickstart_proxy()

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 1498 of file transports.c.

◆ pt_prepare_proxy_list_for_config_read()

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 1558 of file transports.c.

◆ pt_proxies_configuration_pending()

int pt_proxies_configuration_pending ( void  )

Return true if there are still unconfigured managed proxies, or proxies that need restarting.

Definition at line 373 of file transports.c.

Referenced by fetch_bridge_descriptors().

◆ pt_stringify_socks_args()

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 1688 of file transports.c.

Referenced by pt_get_socks_args_for_proxy_addrport().

◆ sweep_proxy_list()

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 1740 of file transports.c.

◆ sweep_transport_list()

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 190 of file transports.c.

◆ tor_escape_str_for_pt_args()

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 1782 of file transports.c.

Referenced by get_transport_options_for_server_proxy().

◆ transport_add_from_config()

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 338 of file transports.c.

◆ transport_free_()

void transport_free_ ( transport_t transport)

Free the pluggable transport struct transport.

Definition at line 166 of file transports.c.

◆ transport_get_by_name()

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 235 of file transports.c.

Referenced by get_transport_by_bridge_addrport(), proxy_prepare_for_restart(), pt_kickstart_proxy(), and transport_resolve_conflicts().