diff options
author | Nick Mathewson <nickm@torproject.org> | 2010-10-01 18:12:30 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2010-10-01 18:14:28 -0400 |
commit | 1bb9734e3a745e2a16b58512f47a6db1229a2b75 (patch) | |
tree | 0ad06edda894e83b3f99dc946d34555014c04ce8 /src/or/nodelist.c | |
parent | 42acef68ad6fbe462a00815fbccf94c817931e8f (diff) | |
download | tor-1bb9734e3a745e2a16b58512f47a6db1229a2b75.tar.gz tor-1bb9734e3a745e2a16b58512f47a6db1229a2b75.zip |
Implement policies for nodes (and for microdescriptors too)
Diffstat (limited to 'src/or/nodelist.c')
-rw-r--r-- | src/or/nodelist.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/or/nodelist.c b/src/or/nodelist.c index 9518114479..d303fc67b4 100644 --- a/src/or/nodelist.c +++ b/src/or/nodelist.c @@ -10,6 +10,7 @@ #include "microdesc.h" #include "networkstatus.h" #include "nodelist.h" +#include "policies.h" #include "router.h" #include "routerlist.h" @@ -597,14 +598,18 @@ node_allows_single_hop_exits(const node_t *node) return 0; } -/** Return true iff it seems that <b>node</b> has an exit policy that - * doesn't actually permit anything to exit. */ +/** Return true iff it seems that <b>node</b> has an exit policy that doesn't + * actually permit anything to exit, or we don't know its exit policy */ int node_exit_policy_rejects_all(const node_t *node) { - (void)node; - UNIMPLEMENTED_NODELIST(); - return 0; + if (node->ri) + return node->ri->policy_is_reject_star; + else if (node->md) + return node->md->exit_policy == NULL || + short_policy_is_reject_star(node->md->exit_policy); + else + return 1; } /** Copy the address for <b>node</b> into *<b>addr_out</b>. */ |