diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-11-29 08:04:41 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-12-16 11:06:18 -0500 |
commit | 1d52ac4d3f67a6e3fac3602f87d00c14060068ab (patch) | |
tree | 6c46116e71af72e049d0f278a85ea09567b6d3ac /src/or/entrynodes.h | |
parent | 89f5f149df984bab00de9868a9305b611c4aa17e (diff) | |
download | tor-1d52ac4d3f67a6e3fac3602f87d00c14060068ab.tar.gz tor-1d52ac4d3f67a6e3fac3602f87d00c14060068ab.zip |
Lay down some infrastructure for bridges in the New Guard Order.
This includes:
* making bridge_info_t exposed but opaque
* allowing guards where we don't know an identity
* making it possible to learn the identity of a guard
* creating a guard that lacks a node_t
* remembering a guard's address and port.
* Looking up a guard by address and port.
* Only enforcing the rule that we need a live consensus to update
the "listed" status for guards when we are not using bridges.
Diffstat (limited to 'src/or/entrynodes.h')
-rw-r--r-- | src/or/entrynodes.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/or/entrynodes.h b/src/or/entrynodes.h index 0abbea8cb6..cbc3f89cb4 100644 --- a/src/or/entrynodes.h +++ b/src/or/entrynodes.h @@ -125,7 +125,9 @@ struct entry_guard_t { * Which selection does this guard belong to? */ char *selection_name; - guard_selection_t *in_selection; + + /** Bridges only: address of the bridge. */ + tor_addr_port_t *bridge_addr; /* ==== Non-persistent fields. */ /* == These are used by sampled guards */ @@ -140,6 +142,9 @@ struct entry_guard_t { * to try again until it either succeeds or fails. Primary guards can * never be pending. */ unsigned is_pending : 1; + /** If true, don't write this guard to disk. (Used for bridges with unknown + * identities) */ + unsigned is_persistent : 1; /** When did we get the earliest connection failure for this guard? * We clear this field on a successful connect. We do _not_ clear it * when we mark the guard as "MAYBE" reachable. @@ -160,6 +165,9 @@ struct entry_guard_t { /** This string holds any fields that we are maintaining because * we saw them in the state, even if we don't understand them. */ char *extra_state_fields; + + /** Backpointer to the guard selection that this guard belongs to. */ + guard_selection_t *in_selection; /**@}*/ /** @@ -554,6 +562,14 @@ STATIC int entry_is_time_to_retry(const entry_guard_t *e, time_t now); void remove_all_entry_guards_for_guard_selection(guard_selection_t *gs); void remove_all_entry_guards(void); +struct bridge_info_t; +// XXXX prop271 should this be a public API? +entry_guard_t *entry_guard_add_bridge_to_sample( + const struct bridge_info_t *bridge); + +void entry_guard_learned_bridge_identity(const tor_addr_port_t *addrport, + const uint8_t *rsa_id_digest); + 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); |