aboutsummaryrefslogtreecommitdiff
path: root/src/or/nodelist.h
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordberg.se>2011-11-24 18:29:56 +0100
committerNick Mathewson <nickm@torproject.org>2011-11-30 11:55:45 -0500
commitf786307ab7f601a3cb41c46df0a09758671a0bcf (patch)
treef4176da46b8baf23f3055fc1240c0c1c4aca3ca6 /src/or/nodelist.h
parent5bee213d236943dac2e08e04c1525e96a62f13f7 (diff)
downloadtor-f786307ab7f601a3cb41c46df0a09758671a0bcf.tar
tor-f786307ab7f601a3cb41c46df0a09758671a0bcf.tar.gz
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/nodelist.h')
-rw-r--r--src/or/nodelist.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/or/nodelist.h b/src/or/nodelist.h
index bd2e63953..70c76d6d1 100644
--- a/src/or/nodelist.h
+++ b/src/or/nodelist.h
@@ -37,10 +37,15 @@ int node_get_purpose(const node_t *node);
(node_get_purpose((node)) == ROUTER_PURPOSE_BRIDGE)
int node_is_me(const node_t *node);
int node_exit_policy_rejects_all(const node_t *node);
-int node_get_addr(const node_t *node, tor_addr_t *addr_out);
-uint32_t node_get_addr_ipv4h(const node_t *node);
+smartlist_t *node_get_all_orports(const node_t *node);
+void node_get_prim_addr(const node_t *node, tor_addr_t *addr_out);
+void node_get_pref_addr(const node_t *node, tor_addr_t *addr_out);
+void node_get_pref_ipv6_addr(const node_t *node, tor_addr_t *addr_out);
+uint32_t node_get_prim_addr_ipv4h(const node_t *node);
int node_allows_single_hop_exits(const node_t *node);
-uint16_t node_get_orport(const node_t *node);
+uint16_t node_get_prim_orport(const node_t *node);
+uint16_t node_get_pref_orport(const node_t *node);
+uint16_t node_get_pref_ipv6_orport(const node_t *node);
const char *node_get_nickname(const node_t *node);
const char *node_get_platform(const node_t *node);
void node_get_address_string(const node_t *node, char *cp, size_t len);
@@ -50,6 +55,11 @@ const smartlist_t *node_get_declared_family(const node_t *node);
smartlist_t *nodelist_get_list(void);
+/* Temporary aliases during transition to multiple addresses. */
+#define node_get_addr(n,a) node_get_prim_addr((n),(a))
+#define node_get_addr_ipv4h(n) node_get_prim_addr_ipv4h((n))
+#define node_get_orport(n) node_get_prim_orport((n))
+
/* XXXX These need to move out of routerlist.c */
void nodelist_refresh_countries(void);
void node_set_country(node_t *node);