diff options
author | Linus Nordberg <linus@nordberg.se> | 2011-11-28 13:51:56 +0100 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-11-30 11:55:46 -0500 |
commit | 39ec781b8fa164dd2b68cec349f2b38d81fa3cbb (patch) | |
tree | 3601cae0bb4294dd1155a2a3856d59c7196cb3ab /src/or/router.c | |
parent | 3b51b326e4fb71b7ec75c5c8ef5a4869f5c4acc1 (diff) | |
download | tor-39ec781b8fa164dd2b68cec349f2b38d81fa3cbb.tar.gz tor-39ec781b8fa164dd2b68cec349f2b38d81fa3cbb.zip |
Make the router_get_*_orport interface consistent with node_*.
Diffstat (limited to 'src/or/router.c')
-rw-r--r-- | src/or/router.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/or/router.c b/src/or/router.c index a0ae79a2a7..6904e85157 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -2132,16 +2132,6 @@ router_get_prim_orport(const routerinfo_t *router, tor_addr_port_t *ap_out) ap_out->port = router->or_port; } -/** Copy the alternative, presumably IPv6, OR port (IP address and TCP - * port) for <b>router</b> into *<b>ap_out</b>. */ -void -router_get_alt_orport(const routerinfo_t *router, tor_addr_port_t *ap_out) -{ - tor_assert(ap_out != NULL); - tor_addr_copy(&ap_out->addr, &router->ipv6_addr); - ap_out->port = router->ipv6_orport; -} - /** Return 1 if we prefer the IPv6 address and OR TCP port of * <b>router</b>, else 0. * @@ -2162,11 +2152,21 @@ void router_get_pref_orport(const routerinfo_t *router, tor_addr_port_t *ap_out) { if (router_ipv6_preferred(router)) - router_get_alt_orport(router, ap_out); + router_get_pref_ipv6_orport(router, ap_out); else router_get_prim_orport(router, ap_out); } +/** Copy the preferred IPv6 OR port (IP address and TCP port) for + * <b>router</b> into *<b>ap_out</b>. */ +void +router_get_pref_ipv6_orport(const routerinfo_t *router, tor_addr_port_t *ap_out) +{ + tor_assert(ap_out != NULL); + tor_addr_copy(&ap_out->addr, &router->ipv6_addr); + ap_out->port = router->ipv6_orport; +} + /** Load the contents of <b>filename</b>, find the last line starting with * <b>end_line</b>, ensure that its timestamp is not more than 25 hours in * the past or more than 1 hour in the future with respect to <b>now</b>, |