diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-11-08 16:10:38 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-11-30 11:55:44 -0500 |
commit | 5f0a8dcd2cfcbafc3deb3a6717808b607a459dac (patch) | |
tree | cab98ff453a2116811274dd2118e61290aadd514 /src/or/config.h | |
parent | 628b735fe39e13cc37afb567b32d4b006da51c89 (diff) | |
download | tor-5f0a8dcd2cfcbafc3deb3a6717808b607a459dac.tar.gz tor-5f0a8dcd2cfcbafc3deb3a6717808b607a459dac.zip |
Initial hacking for proposal 186.
This code handles the new ORPort options, and incidentally makes all
remaining port types use the new port configuration systems.
There are some rough edges! It doesn't do well in the case where your
Address says one thing but you say to Advertise another ORPort. It
doesn't handle AllAddrs. It doesn't actually advertise anything besides
the first listed advertised IPv4 ORPort and DirPort. It doesn't do
port forwarding to them either.
It's not tested either, it needs more documentation, and it probably
forgets to put the milk back in the refrigerator.
Diffstat (limited to 'src/or/config.h')
-rw-r--r-- | src/or/config.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/or/config.h b/src/or/config.h index e1fc5cfe9a..a202bffa50 100644 --- a/src/or/config.h +++ b/src/or/config.h @@ -64,7 +64,12 @@ or_state_t *get_or_state(void); int did_last_state_file_write_fail(void); int or_state_save(time_t now); -const smartlist_t *get_configured_client_ports(void); +const smartlist_t *get_configured_ports(void); +int get_first_advertised_v4_port_by_type(int listener_type); +#define get_primary_or_port() \ + (get_first_advertised_v4_port_by_type(CONN_TYPE_OR_LISTENER)) +#define get_primary_dir_port() \ + (get_first_advertised_v4_port_by_type(CONN_TYPE_DIR_LISTENER)) int options_need_geoip_info(const or_options_t *options, const char **reason_out); |