diff options
author | teor <teor@riseup.net> | 2020-05-11 17:42:05 +1000 |
---|---|---|
committer | teor <teor@riseup.net> | 2020-05-18 21:53:52 +1000 |
commit | 2ea1692c20b4afa929e9f1c6da16ee2fb134abe0 (patch) | |
tree | 6f8ac6040e505b265da45eedddb283005fca1974 /src/feature/nodelist | |
parent | 48413dc65f0d84b9d7c9566d1ecda359a1210dda (diff) | |
download | tor-2ea1692c20b4afa929e9f1c6da16ee2fb134abe0.tar.gz tor-2ea1692c20b4afa929e9f1c6da16ee2fb134abe0.zip |
nodelist: Rewrite router_crn_flags_t
Re-order the flags in a logical order, and re-number them.
Add missing comments, fix comment typos.
Part of 34200.
Diffstat (limited to 'src/feature/nodelist')
-rw-r--r-- | src/feature/nodelist/node_select.h | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/feature/nodelist/node_select.h b/src/feature/nodelist/node_select.h index 29b6e6f2c8..1776d8ea1a 100644 --- a/src/feature/nodelist/node_select.h +++ b/src/feature/nodelist/node_select.h @@ -14,22 +14,26 @@ /** Flags to be passed to control router_choose_random_node() to indicate what * kind of nodes to pick according to what algorithm. */ typedef enum router_crn_flags_t { + /* Try to choose stable nodes. */ CRN_NEED_UPTIME = 1<<0, + /* Try to choose nodes with a reasonable amount of bandwidth. */ CRN_NEED_CAPACITY = 1<<1, - CRN_NEED_GUARD = 1<<2, - /* XXXX not used, apparently. */ - CRN_WEIGHT_AS_EXIT = 1<<5, - CRN_NEED_DESC = 1<<6, - /* On clients, only provide nodes that satisfy ClientPreferIPv6OR */ - CRN_PREF_ADDR = 1<<7, + /* Only choose nodes if we have downloaded their descriptor or + * microdescriptor. */ + CRN_NEED_DESC = 1<<2, + /* Choose nodes that can be used as Guard relays. */ + CRN_NEED_GUARD = 1<<3, /* On clients, only provide nodes that we can connect to directly, based on - * our firewall rules */ - CRN_DIRECT_CONN = 1<<8, - /* On clients, only provide nodes with HSRend >= 2 protocol version which - * is required for hidden service version >= 3. */ - CRN_RENDEZVOUS_V3 = 1<<9, + * our firewall rules. */ + CRN_DIRECT_CONN = 1<<4, + /* On clients, if choosing a node for a direct connection, only provide + * nodes that satisfy ClientPreferIPv6OR. */ + CRN_PREF_ADDR = 1<<5, + /* On clients, only provide nodes with HSRend=2 protocol version which + * is required for hidden service version 3. */ + CRN_RENDEZVOUS_V3 = 1<<6, /* On clients, only provide nodes that can initiate IPv6 extends. */ - CRN_INITIATE_IPV6_EXTEND = 1<<10, + CRN_INITIATE_IPV6_EXTEND = 1<<7, } router_crn_flags_t; /** Possible ways to weight routers when choosing one randomly. See |