diff options
author | Linus Nordberg <linus@nordberg.se> | 2011-11-24 18:29:56 +0100 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-11-30 11:55:45 -0500 |
commit | f786307ab7f601a3cb41c46df0a09758671a0bcf (patch) | |
tree | f4176da46b8baf23f3055fc1240c0c1c4aca3ca6 /src/or/router.h | |
parent | 5bee213d236943dac2e08e04c1525e96a62f13f7 (diff) | |
download | tor-f786307ab7f601a3cb41c46df0a09758671a0bcf.tar.gz tor-f786307ab7f601a3cb41c46df0a09758671a0bcf.zip |
First chunk of support for bridges on IPv6
Comments below focus on changes, see diff for added code.
New type tor_addr_port_t holding an IP address and a TCP/UDP port.
New flag in routerinfo_t, ipv6_preferred. This should go in the
node_t instead but not now.
Replace node_get_addr() with
- node_get_prim_addr() for primary address, i.e. IPv4 for now
- node_get_pref_addr() for preferred address, IPv4 or IPv6.
Rename node_get_addr_ipv4h() node_get_prim_addr_ipv4h() for
consistency. The primary address will not allways be an IPv4 address.
Same for node_get_orport() -> node_get_prim_orport().
Rewrite node_is_a_configured_bridge() to take all OR ports into account.
Extend argument list to extend_info_from_node and
extend_info_from_router with a flag indicating if we want to use the
routers primary address or the preferred address. Use the preferred
address in as few situtations as possible for allowing clients to
connect to bridges over IPv6.
Diffstat (limited to 'src/or/router.h')
-rw-r--r-- | src/or/router.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/or/router.h b/src/or/router.h index 6a9851cdbd..4094b665dc 100644 --- a/src/or/router.h +++ b/src/or/router.h @@ -85,6 +85,13 @@ int router_pick_published_address(const or_options_t *options, uint32_t *addr); int router_rebuild_descriptor(int force); int router_dump_router_to_string(char *s, size_t maxlen, routerinfo_t *router, crypto_pk_env_t *ident_key); +void router_get_prim_addr_port(const routerinfo_t *router, tor_addr_t *addr_out, + uint16_t *port_out); +void router_get_alt_addr_port(const routerinfo_t *router, tor_addr_t *addr_out, + uint16_t *port_out); +void router_get_pref_addr_port(const routerinfo_t *router, tor_addr_t *addr_out, + uint16_t *port_out); +int router_ipv6_preferred(const routerinfo_t *router); int extrainfo_dump_to_string(char **s, extrainfo_t *extrainfo, crypto_pk_env_t *ident_key); int is_legal_nickname(const char *s); |