diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-01-18 15:27:10 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-01-18 15:27:10 -0500 |
commit | 472b277207219d791a399d4d449af6ffdf00a081 (patch) | |
tree | 5a174ebfac759081c1c6c2adf614c43cc75325c3 /src/or/entrynodes.h | |
parent | e167a0e17d9211205651b07b65b0e83695bf6cf1 (diff) | |
download | tor-472b277207219d791a399d4d449af6ffdf00a081.tar.gz tor-472b277207219d791a399d4d449af6ffdf00a081.zip |
Remove the (no longer compiled) code for legacy guard selection.
Part of 20830.
Diffstat (limited to 'src/or/entrynodes.h')
-rw-r--r-- | src/or/entrynodes.h | 122 |
1 files changed, 0 insertions, 122 deletions
diff --git a/src/or/entrynodes.h b/src/or/entrynodes.h index 5fa0fec37f..a1ede71971 100644 --- a/src/or/entrynodes.h +++ b/src/or/entrynodes.h @@ -28,11 +28,6 @@ typedef struct circuit_guard_state_t circuit_guard_state_t; private. */ typedef struct entry_guard_restriction_t entry_guard_restriction_t; -/* - XXXX Prop271 undefine this in order to disable all legacy guard functions. -*/ -// #define ENABLE_LEGACY_GUARD_ALGORITHM - /* Information about a guard's pathbias status. * These fields are used in circpathbias.c to try to detect entry * nodes that are failing circuits at a suspicious frequency. @@ -179,37 +174,6 @@ struct entry_guard_t { guard_selection_t *in_selection; /**@}*/ -#ifdef ENABLE_LEGACY_GUARD_ALGORITHM - /** - * @name legacy guard selection algorithm fields - * - * These are used and maintained by the legacy (pre-prop271) entry guard - * algorithm. Most of them we will remove as prop271 gets implemented. - * The rest we'll migrate over, if they are 100% semantically identical to - * their prop271 equivalents. XXXXprop271 - */ - /**@{*/ - time_t chosen_on_date; /**< Approximately when was this guard added? - * "0" if we don't know. */ - char *chosen_by_version; /**< What tor version added this guard? NULL - * if we don't know. */ - unsigned int made_contact : 1; /**< 0 if we have never connected to this - * router, 1 if we have. */ - unsigned int can_retry : 1; /**< Should we retry connecting to this entry, - * in spite of having it marked as unreachable?*/ - unsigned int is_dir_cache : 1; /**< Is this node a directory cache? */ - time_t bad_since; /**< 0 if this guard is currently usable, or the time at - * which it was observed to become (according to the - * directory or the user configuration) unusable. */ - time_t unreachable_since; /**< 0 if we can connect to this guard, or the - * time at which we first noticed we couldn't - * connect to it. */ - time_t last_attempted; /**< 0 if we can connect to this guard, or the time - * at which we last failed to connect to it. */ - - /**}@*/ -#endif - /** Path bias information for this guard. */ guard_pathbias_t pb; }; @@ -305,20 +269,6 @@ struct guard_selection_s { * confirmed_entry_guards receive? */ int next_confirmed_idx; -#ifdef ENABLE_LEGACY_GUARD_ALGORITHM - /** - * A list of our chosen entry guards, as entry_guard_t structures; this - * preserves the pre-Prop271 behavior. - */ - smartlist_t *chosen_entry_guards; - - /** - * When we try to choose an entry guard, should we parse and add - * config's EntryNodes first? This was formerly a global. This - * preserves the pre-Prop271 behavior. - */ - int should_add_entry_nodes; -#endif }; struct entry_guard_handle_t; @@ -378,11 +328,6 @@ entry_guard_t *entry_guard_get_by_id_digest(const char *digest); void entry_guards_changed_for_guard_selection(guard_selection_t *gs); void entry_guards_changed(void); guard_selection_t * get_guard_selection_info(void); -#ifdef ENABLE_LEGACY_GUARD_ALGORITHM -const smartlist_t *get_entry_guards_for_guard_selection( - guard_selection_t *gs); -const smartlist_t *get_entry_guards(void); -#endif int num_live_entry_guards_for_guard_selection( guard_selection_t *gs, int for_directory); @@ -390,9 +335,6 @@ int num_live_entry_guards(int for_directory); #endif const node_t *entry_guard_find_node(const entry_guard_t *guard); -#ifdef ENABLE_LEGACY_GUARD_ALGORITHM -void entry_guard_mark_bad(entry_guard_t *guard); -#endif const char *entry_guard_get_rsa_id_digest(const entry_guard_t *guard); const char *entry_guard_describe(const entry_guard_t *guard); guard_pathbias_t *entry_guard_get_pathbias_state(entry_guard_t *guard); @@ -432,10 +374,6 @@ void entry_guards_note_internet_connectivity(guard_selection_t *gs); int update_guard_selection_choice(const or_options_t *options); /* Used by bridges.c only. */ -#ifdef ENABLE_LEGACY_GUARD_ALGORITHM -void add_bridge_as_entry_guard(guard_selection_t *gs, - const node_t *chosen); -#endif int num_bridges_usable(void); #ifdef ENTRYNODES_PRIVATE @@ -612,68 +550,13 @@ STATIC unsigned entry_guards_note_guard_success(guard_selection_t *gs, STATIC int entry_guard_has_higher_priority(entry_guard_t *a, entry_guard_t *b); STATIC char *getinfo_helper_format_single_entry_guard(const entry_guard_t *e, int is_legacy); -#ifdef ENABLE_LEGACY_GUARD_ALGORITHM -// ---------- XXXX this stuff is pre-prop271. - -STATIC const node_t *add_an_entry_guard(guard_selection_t *gs, - const node_t *chosen, - int reset_status, int prepend, - int for_discovery, int for_directory); -STATIC int populate_live_entry_guards(smartlist_t *live_entry_guards, - const smartlist_t *all_entry_guards, - const node_t *chosen_exit, - dirinfo_type_t dirinfo_type, - int for_directory, - int need_uptime, int need_capacity); -STATIC int decide_num_guards(const or_options_t *options, int for_directory); - -STATIC void entry_guards_set_from_config(guard_selection_t *gs, - const or_options_t *options); - -/** Flags to be passed to entry_is_live() to indicate what kind of - * entry nodes we are looking for. */ -typedef enum { - ENTRY_NEED_UPTIME = 1<<0, - ENTRY_NEED_CAPACITY = 1<<1, - ENTRY_ASSUME_REACHABLE = 1<<2, - ENTRY_NEED_DESCRIPTOR = 1<<3, -} entry_is_live_flags_t; - -STATIC const node_t *entry_is_live(const entry_guard_t *e, - entry_is_live_flags_t flags, - const char **msg); - -STATIC int entry_is_time_to_retry(const entry_guard_t *e, time_t now); -#endif - -#endif - -#ifdef ENABLE_LEGACY_GUARD_ALGORITHM -void remove_all_entry_guards_for_guard_selection(guard_selection_t *gs); -void remove_all_entry_guards(void); #endif struct bridge_info_t; void entry_guard_learned_bridge_identity(const tor_addr_port_t *addrport, const uint8_t *rsa_id_digest); -#ifdef ENABLE_LEGACY_GUARD_ALGORITHM -void entry_guards_compute_status_for_guard_selection( - guard_selection_t *gs, const or_options_t *options, time_t now); -void entry_guards_compute_status(const or_options_t *options, time_t now); -int entry_guard_register_connect_status_for_guard_selection( - guard_selection_t *gs, const char *digest, int succeeded, - int mark_relay_status, time_t now); -int entry_guard_register_connect_status(const char *digest, int succeeded, - int mark_relay_status, time_t now); -void entry_nodes_should_be_added_for_guard_selection(guard_selection_t *gs); -void entry_nodes_should_be_added(void); -#endif int entry_list_is_constrained(const or_options_t *options); -#ifdef ENABLE_LEGACY_GUARD_ALGORITHM -const node_t *choose_random_entry(cpath_build_state_t *state); -const node_t *choose_random_dirguard(dirinfo_type_t t); -#endif int guards_retry_optimistic(const or_options_t *options); int entry_guards_parse_state_for_guard_selection( guard_selection_t *gs, or_state_t *state, int set, char **msg); @@ -682,11 +565,6 @@ void entry_guards_update_state(or_state_t *state); int getinfo_helper_entry_guards(control_connection_t *conn, const char *question, char **answer, const char **errmsg); -#ifdef ENABLE_LEGACY_GUARD_ALGORITHM -int is_node_used_as_guard_for_guard_selection(guard_selection_t *gs, - const node_t *node); -MOCK_DECL(int, is_node_used_as_guard, (const node_t *node)); -#endif int entries_known_but_down(const or_options_t *options); void entries_retry_all(const or_options_t *options); |