diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-11-22 14:22:54 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-11-30 14:44:43 -0500 |
commit | 858c8f5593e573cdf36c360141cf6e96d91d6474 (patch) | |
tree | 1ce761406d81b6575828b8999f72aa17887c58ff /src/or/entrynodes.h | |
parent | dbbaa515183e250e20c40fa7b4c00df9487058fa (diff) | |
download | tor-858c8f5593e573cdf36c360141cf6e96d91d6474.tar.gz tor-858c8f5593e573cdf36c360141cf6e96d91d6474.zip |
Make new prop271 entry guards persistent
To do this, it makes sense to treat legacy guards as a separate
guard_selection_t *, and handle them separately. This also means we
add support here for having multiple guard selections.
Note that we don't persist pathbias information yet; that will take
some refactoring.
Diffstat (limited to 'src/or/entrynodes.h')
-rw-r--r-- | src/or/entrynodes.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/or/entrynodes.h b/src/or/entrynodes.h index 7dcedd6066..d8468eb287 100644 --- a/src/or/entrynodes.h +++ b/src/or/entrynodes.h @@ -121,6 +121,11 @@ struct entry_guard_t { * item should occur in the CONFIRMED_GUARDS ordered * list */ + /** + * Which selection does this guard belong to? + */ + char *selection_name; + /* ==== Non-persistent fields. */ /* == These are used by sampled guards */ /** When did we last decide to try using this guard for a circuit? 0 for @@ -203,6 +208,11 @@ struct entry_guard_t { */ struct guard_selection_s { /** + * The name for this guard-selection object. (Must not contain spaces). + */ + char *name; + + /** * A value of 1 means that guard_selection_t structures have changed * and those changes need to be flushed to disk. * @@ -398,7 +408,7 @@ int num_bridges_usable(void); // ---------- XXXX these functions and definitions are post-prop271. HANDLE_DECL(entry_guard, entry_guard_t, STATIC) -STATIC guard_selection_t *guard_selection_new(void); +STATIC guard_selection_t *guard_selection_new(const char *name); STATIC void guard_selection_free(guard_selection_t *gs); STATIC entry_guard_t *get_sampled_guard_with_id(guard_selection_t *gs, const uint8_t *rsa_id); @@ -459,8 +469,6 @@ STATIC unsigned entry_guards_note_guard_success(guard_selection_t *gs, unsigned old_state); STATIC int entry_guard_has_higher_priority(entry_guard_t *a, entry_guard_t *b); -void entry_guards_DUMMY_ENTRY_POINT(void); - // ---------- XXXX this stuff is pre-prop271. STATIC const node_t *add_an_entry_guard(guard_selection_t *gs, |