aboutsummaryrefslogtreecommitdiff
path: root/src/or/nodelist.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2010-09-30 18:25:25 -0400
committerNick Mathewson <nickm@torproject.org>2010-10-01 18:14:27 -0400
commitf9ea242acabcaec0ab0fbd0de5e9999dfcdb0193 (patch)
treee57665d063579cf465b6f6be48c5b699c09bd8b2 /src/or/nodelist.c
parent45f1e4d5ee7b6e2308655628d18a67d330d9b624 (diff)
downloadtor-f9ea242acabcaec0ab0fbd0de5e9999dfcdb0193.tar.gz
tor-f9ea242acabcaec0ab0fbd0de5e9999dfcdb0193.zip
Implement node-based router family code
Also, make the NodeFamily option into a list of routersets. This lets us git rid of router_in_nickname_list (or whatever it was called) without porting it to work with nodes, and also lets people specify country codes and IP ranges in NodeFamily
Diffstat (limited to 'src/or/nodelist.c')
-rw-r--r--src/or/nodelist.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/or/nodelist.c b/src/or/nodelist.c
index dd83abf54e..7c036982d5 100644
--- a/src/or/nodelist.c
+++ b/src/or/nodelist.c
@@ -698,6 +698,19 @@ node_is_me(const node_t *node)
return router_digest_is_me(node->identity);
}
+/** Return <b>node</b> declared family (as a list of names), or NULL if
+ * the node didn't declare a family. */
+const smartlist_t *
+node_get_declared_family(const node_t *node)
+{
+ if (node->ri && node->ri->declared_family)
+ return node->ri->declared_family;
+ else if (node->md && node->md->family)
+ return node->md->family;
+ else
+ return NULL;
+}
+
/* KILLTHIS XXXX NM -- it's a dummy to keep UNIMPLEMENTED_NODELIST()
* working */
int unimplemented_nodelist_truth = 1;