summaryrefslogtreecommitdiff
path: root/src/or/nodelist.h
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordberg.se>2011-11-28 12:15:58 +0100
committerNick Mathewson <nickm@torproject.org>2011-11-30 11:55:46 -0500
commit2376a6ade4c5258da5512885eba28e3e0461f2a8 (patch)
tree3d310f9a31e82ee76f69e52639bb4094d1b647fb /src/or/nodelist.h
parent529820f8baeaccc6efffde1d9b241eb9f11ce82f (diff)
downloadtor-2376a6ade4c5258da5512885eba28e3e0461f2a8.tar.gz
tor-2376a6ade4c5258da5512885eba28e3e0461f2a8.zip
Merge node_get_{prim,pref,pref_ipv6}_addr with their _orport counterparts.
This keeps the IP address and TCP for a given OR port together, reducing the risk of using an address for one address family with a port of another. Make node_get_addr() a wrapper function for compatibility.
Diffstat (limited to 'src/or/nodelist.h')
-rw-r--r--src/or/nodelist.h15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/or/nodelist.h b/src/or/nodelist.h
index 70c76d6d13..1b7549dade 100644
--- a/src/or/nodelist.h
+++ b/src/or/nodelist.h
@@ -38,14 +38,12 @@ int node_get_purpose(const node_t *node);
int node_is_me(const node_t *node);
int node_exit_policy_rejects_all(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);
+void node_get_prim_orport(const node_t *node, tor_addr_port_t *addr_port_out);
+void node_get_pref_orport(const node_t *node, tor_addr_port_t *addr_port_out);
+void node_get_pref_ipv6_orport(const node_t *node,
+ tor_addr_port_t *addr_port_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_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);
@@ -55,10 +53,9 @@ 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))
+/* Temporary during transition to multiple addresses. */
+void node_get_addr(const node_t *node, tor_addr_t *addr_out);
#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);