diff options
author | teor <teor2345@gmail.com> | 2015-01-10 17:20:06 +1100 |
---|---|---|
committer | teor <teor2345@gmail.com> | 2015-01-10 17:20:06 +1100 |
commit | f8ffb57bc4430ff9bbd7560eecdda4284b2799ba (patch) | |
tree | 7b73b0bf39d756c31bb62dbcd3c239864a6a46c8 /src/or/nodelist.h | |
parent | debd7862bb6d641c13fe4ee019da633c683d740e (diff) | |
parent | 33df3e37ffecfed309a1a0f210a96620c0ebb837 (diff) | |
download | tor-f8ffb57bc4430ff9bbd7560eecdda4284b2799ba.tar.gz tor-f8ffb57bc4430ff9bbd7560eecdda4284b2799ba.zip |
Merge branch 'master' of https://git.torproject.org/tor into bug13111-empty-key-files-fn-empty
Conflicts:
src/or/connection_edge.c
Merged in favour of origin.
Diffstat (limited to 'src/or/nodelist.h')
-rw-r--r-- | src/or/nodelist.h | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/src/or/nodelist.h b/src/or/nodelist.h index 48b0e94be0..a131e0dd4e 100644 --- a/src/or/nodelist.h +++ b/src/or/nodelist.h @@ -1,7 +1,7 @@ /* Copyright (c) 2001 Matej Pfajfar. * Copyright (c) 2001-2004, Roger Dingledine. * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson. - * Copyright (c) 2007-2014, The Tor Project, Inc. */ + * Copyright (c) 2007-2015, The Tor Project, Inc. */ /* See LICENSE for licensing information */ /** @@ -79,7 +79,37 @@ int node_is_unreliable(const node_t *router, int need_uptime, int router_exit_policy_all_nodes_reject(const tor_addr_t *addr, uint16_t port, int need_uptime); void router_set_status(const char *digest, int up); + +/** router_have_minimum_dir_info tests to see if we have enough + * descriptor information to create circuits. + * If there are exits in the consensus, we wait until we have enough + * info to create exit paths before creating any circuits. If there are + * no exits in the consensus, we wait for enough info to create internal + * paths, and should avoid creating exit paths, as they will simply fail. + * We make sure we create all available circuit types at the same time. */ int router_have_minimum_dir_info(void); + +/** Set to CONSENSUS_PATH_EXIT if there is at least one exit node + * in the consensus. We update this flag in compute_frac_paths_available if + * there is at least one relay that has an Exit flag in the consensus. + * Used to avoid building exit circuits when they will almost certainly fail. + * Set to CONSENSUS_PATH_INTERNAL if there are no exits in the consensus. + * (This situation typically occurs during bootstrap of a test network.) + * Set to CONSENSUS_PATH_UNKNOWN if we have never checked, or have + * reason to believe our last known value was invalid or has expired. + */ +typedef enum { + /* we haven't checked yet, or we have invalidated our previous check */ + CONSENSUS_PATH_UNKNOWN = -1, + /* The consensus only has internal relays, and we should only + * create internal paths, circuits, streams, ... */ + CONSENSUS_PATH_INTERNAL = 0, + /* The consensus has at least one exit, and can therefore (potentially) + * create exit and internal paths, circuits, streams, ... */ + CONSENSUS_PATH_EXIT = 1 +} consensus_path_type_t; +consensus_path_type_t router_have_consensus_path(void); + void router_dir_info_changed(void); const char *get_dir_info_status_string(void); int count_loading_descriptors_progress(void); |