config: Delete get_list_of_ports_to_forward()

Tor has not supported automatic port forwarding for some time.
This commit is contained in:
teor 2019-10-30 16:50:20 +10:00
parent 8036954bf5
commit d665458085
2 changed files with 0 additions and 39 deletions

View File

@ -6890,43 +6890,6 @@ write_to_data_subdir(const char* subdir, const char* fname,
return return_val;
}
/** Return a smartlist of ports that must be forwarded by
* tor-fw-helper. The smartlist contains the ports in a string format
* that is understandable by tor-fw-helper. */
smartlist_t *
get_list_of_ports_to_forward(void)
{
smartlist_t *ports_to_forward = smartlist_new();
int port = 0;
/** XXX TODO tor-fw-helper does not support forwarding ports to
other hosts than the local one. If the user is binding to a
different IP address, tor-fw-helper won't work. */
port = router_get_advertised_or_port(get_options()); /* Get ORPort */
if (port)
smartlist_add_asprintf(ports_to_forward, "%d:%d", port, port);
port = router_get_advertised_dir_port(get_options(), 0); /* Get DirPort */
if (port)
smartlist_add_asprintf(ports_to_forward, "%d:%d", port, port);
/* Get ports of transport proxies */
{
smartlist_t *transport_ports = get_transport_proxy_ports();
if (transport_ports) {
smartlist_add_all(ports_to_forward, transport_ports);
smartlist_free(transport_ports);
}
}
if (!smartlist_len(ports_to_forward)) {
smartlist_free(ports_to_forward);
ports_to_forward = NULL;
}
return ports_to_forward;
}
/** Helper to implement GETINFO functions about configuration variables (not
* their values). Given a "config/names" question, set *<b>answer</b> to a
* new string describing the supported configuration variables and their

View File

@ -182,8 +182,6 @@ char *get_first_listener_addrport_string(int listener_type);
int options_need_geoip_info(const or_options_t *options,
const char **reason_out);
smartlist_t *get_list_of_ports_to_forward(void);
int getinfo_helper_config(control_connection_t *conn,
const char *question, char **answer,
const char **errmsg);