diff options
author | George Kadianakis <desnacked@riseup.net> | 2012-06-07 19:20:36 +0300 |
---|---|---|
committer | George Kadianakis <desnacked@riseup.net> | 2012-09-05 18:08:18 +0300 |
commit | da16c425ef8c17a753ae0abc3fdb26a328004062 (patch) | |
tree | ca4cb298c5393740d44dd616cd4ef5b7c86d7309 /src/or/transports.c | |
parent | cd05f35d2cdf50d31108428cf5c19549d468dbc0 (diff) | |
download | tor-da16c425ef8c17a753ae0abc3fdb26a328004062.tar.gz tor-da16c425ef8c17a753ae0abc3fdb26a328004062.zip |
Start passing ports to tor_check_port_forwarding().
Conflicts:
src/or/transports.c
Diffstat (limited to 'src/or/transports.c')
-rw-r--r-- | src/or/transports.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/or/transports.c b/src/or/transports.c index 9edeebdba9..f2c604ce8b 100644 --- a/src/or/transports.c +++ b/src/or/transports.c @@ -1324,6 +1324,33 @@ pt_prepare_proxy_list_for_config_read(void) tor_assert(unconfigured_proxies_n == 0); } +/** Return a smartlist containing the ports where our pluggable + * transports are listening. */ +smartlist_t * +get_transport_proxy_ports(void) +{ + smartlist_t *sl = NULL; + + if (!managed_proxy_list) + return NULL; + + /** XXX assume that external proxy ports have been forwarded + manually */ + SMARTLIST_FOREACH_BEGIN(managed_proxy_list, const managed_proxy_t *, mp) { + if (!mp->is_server || mp->conf_state != PT_PROTO_COMPLETED) + continue; + + if (!sl) sl = smartlist_new(); + + tor_assert(mp->transports); + SMARTLIST_FOREACH(mp->transports, const transport_t *, t, + smartlist_add_asprintf(sl, "%u:%u", t->port, t->port)); + + } SMARTLIST_FOREACH_END(mp); + + return sl; +} + /** 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 |