summaryrefslogtreecommitdiff
path: root/src/or/entrynodes.h
AgeCommit message (Collapse)Author
2016-12-16Lay down some infrastructure for bridges in the New Guard Order.Nick Mathewson
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.
2016-12-16Remove guard_selection argument from status-reporting functionsNick Mathewson
This prevents us from mixing up multiple guard_selections
2016-12-16Add a backpointer from entry_guard_t to guard_selection_tNick Mathewson
This is safe, because no entry_guard_t ever outlives its guard_selection_t. I want this because now that multiple guard selections can be active during one tor session, we should make sure that any information we register about guards is with respect to the selection that they came from.
2016-12-16Have multiple guard contexts we can switch between.Nick Mathewson
Currently, this code doesn't actually have the contexts behave differently, (except for the legacy context), but it does switch back and forth between them nicely.
2016-12-16Unit tests for entry_guard_{pick_for_circuit,succeeded,failed}Nick Mathewson
2016-12-16Turn #defines for prop271 into networkstatus paramsNick Mathewson
Some of these will get torrc options to override them too; this is just the mechanical conversion. Also, add documentation for a couple of undocumented (but now used) parameters.
2016-12-16Expire circuits that have been WAITING_FOR_BETTER_GUARD too longNick Mathewson
(This is required by 3.9 in prop271, but is better done as a separate function IMO)
2016-12-16Move the 'dirty' flag for the guards to a global againNick Mathewson
It makes more sense to have a single dirty flag, since we always regenerate the whole state file when we save it.
2016-12-16Test get_guard_selection_by_nameNick Mathewson
2016-12-16Make sure primary-guards are up-to-date when we inspect them.Nick Mathewson
(Plus some magic to prevent and detect recursive invocation of entry_guards_update_primary(), since that can cause some pretty tricky misbehavior.)
2016-12-16Rebuild the guard lists as appropriate on torrc change.Nick Mathewson
(Also, prepare to tie guard changes into the mark-all-old-circuits logic.)
2016-11-30Make new prop271 entry guards persistentNick Mathewson
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.
2016-11-30Use the new guard notification/selection APIs throughout TorNick Mathewson
This patch doesn't cover every case; omitted cases are marked with "XXXX prop271", as usual. It leaves both the old interface and the new interface for guard status notification, since they don't actually work in the same way: the new API wants to be told when a circuit has failed or succeeded, whereas the old API wants to know when a channel has failed or succeeded. I ran into some trouble with directory guard stuff, since when we pick the directory guard, we don't actually have a circuit to associate it with. I solved that by allowing guard states to be associated with directory connections, not just circuits.
2016-11-30Function to cancel a guard state.Nick Mathewson
We'll want to use this if we allocate a guard state then decide, "whoops, we don't want to use this."
2016-11-30New function to tell the guard module "We're on the net!"Nick Mathewson
(Call it whenever we read a cell.)
2016-11-30Write the easy parts of the public entryguard interface.Nick Mathewson
Here we add a little bit of state to origin circuits, and set up the necessary functions for the circuit code to call in order to find guards, use guards, and decide when circuits can be used. There's also an incomplete function for the hard part of the circuit-maintenance code, where we figure out whether any waiting guards are ready to become usable. (This patch finally uses the handle.c code to make safe handles to entry_guard_t objects, so that we are allowed to free an entry_guard_t without checking whether any origin_circuit_t is holding a reference to it.)
2016-11-30Implement most of the prop271 data structure backends.Nick Mathewson
This code handles: * Maintaining the sampled set, the filtered set, and the usable_filtered set. * Maintaining the confirmed and primary guard lists. * Picking guards for circuits, and updating guard state when circuit state changes. Additionally, I've done code structure movement: even more constants and structures from entrynodes.c have become ENTRYNODES_PRIVATE fields of entrynodes.h. I've also included a bunch of documentation and a bunch of unit tests. Coverage on the new code is pretty high. I've noted important things to resolve before this branch is done with the /XXXX.*prop271/ regex.
2016-11-30Add accessors as needed to repair compilationNick Mathewson
The previous commit, in moving a bunch of functions to bridges.c, broke compilation because bridges.c required two entry points to entrynodes.c it didn't have.
2016-11-30Split bridge functions into a new module.Nick Mathewson
This patch is just: * Code movement * Adding headers here and there as needed * Adding a bridges_free_all() with a call to it. It breaks compilation, since the bridge code needed to make exactly 2 calls into entrynodes.c internals. I'll fix those in the next commit.
2016-11-30Initial code to parse/encode/sample prop271 guardsNick Mathewson
The encoding code is very straightforward. The decoding code is a bit tricky, but clean-ish. The sampling code is untested and probably needs more work.
2016-11-30Add the prop271 fields to entry_guard_t. Not used yet.Nick Mathewson
2016-11-30Make entry_guard_t opaque to circpathbias.cNick Mathewson
This was a relatively mechanical change. First, I added an accessor function for the pathbias-state field of a guard. Then I did a search-and-replace in circpathbias.c to replace "guard->pb." with "pb->". Finally, I made sure that "pb" was declared whenever it was needed.
2016-11-30Fix remaining case of circpathbias inspecting entryguard internalsNick Mathewson
2016-11-30Add an entry_guard_describe() functionNick Mathewson
This function helpfully removes all but one remaining use of an entry_guard_t private field in pathbias.c
2016-11-30Move path-bias fields into a separate structureNick Mathewson
(Other than the field movement, the code changes here are just search-and-replace)
2016-11-30prop271: make entry_guard_t mostly-privateNick Mathewson
The entry_guard_t structure should really be opaque, so that we can change its contents and have the rest of Tor not care. This commit makes it "mostly opaque" -- circpathbias.c can still see inside it. (I'm making circpathbias.c exempt since it's the only part of Tor outside of entrynodes.c that made serious use of entry_guard_t internals.)
2016-10-26More module documentation (circpathbias, circuitlist)Nick Mathewson
2016-10-19Merge remote-tracking branch 'andrea/ticket19858_v2'Nick Mathewson
Conflict in entrynodes.c: any_bridge_supports_microdescriptors was removed in master, and modified in 19858_v2
2016-10-01Bridge-using clients now use their cached microdesc consensusRoger Dingledine
Clients that use bridges were ignoring their cached microdesc-flavor consensus files, because they only thought they should use the microdesc flavor once they had a known-working bridge that could offer microdescs, and at first boot no bridges are known-working. This bug caused bridge-using clients to download a new microdesc consensus on each startup. Fixes bug 20269; bugfix on 0.2.3.12-alpha.
2016-09-25Abolish globals in entrynodes.c; relativize guard context to new ↵Andrea Shepard
guard_selection_t structure
2016-06-29Expose GETINFO download status statics for test suite and make things mockableAndrea Shepard
2016-06-29Add bridge descriptor download status queries to GETINFOAndrea Shepard
2016-03-24Always allow OR connections to bridges on private addressesteor (Tim Wilson-Brown)
Regardless of the setting of ExtendAllowPrivateAddresses. This fixes a bug with pluggable transports that ignore the (potentially private) address in their bridge line. Fixes bug 18517; bugfix on 23b088907f in tor-0.2.8.1-alpha.
2016-02-27Update the copyright year.Nick Mathewson
2015-02-18clean up comments and whitespace a bitRoger Dingledine
2015-02-18Calculate the guardfraction bandwidth of a guard.George Kadianakis
2015-02-18Parse GuardFraction info from consensuses and votes.George Kadianakis
Also introduce the UseGuardFraction torrc option which decides whether clients should use guardfraction information found in the consensus.
2015-01-02Bump copyright dates to 2015, in case someday this matters.Nick Mathewson
2014-11-04Merge remote-tracking branch 'andrea/ticket6456'Nick Mathewson
Somewhat tricky conflicts: src/or/config.c Also, s/test_assert/tt_assert in test_config.c
2014-10-28Add another year to our copyright dates.Nick Mathewson
Because in 95 years, we or our successors will surely care about enforcing the BSD license terms on this code. Right?
2014-08-20Unit testing entry_is_time_to_retry().rl1987
2014-07-25Add some mocks needed to unit test ↵Andrea Shepard
ClientTransportPlugin/ServerTransportPlugin config line parsing
2014-07-16Fix wide lines, make entry_is_live() non-inlineNick Mathewson
2014-06-25Change the interface of entry_is_live() to take a bitmap.George Kadianakis
2014-06-25Basic entry_is_live() unittest.George Kadianakis
2014-06-15Make a few entrynodes.c functions testable.George Kadianakis
2014-03-25Fix warnings from doxygenNick Mathewson
Most of these are simple. The only nontrivial part is that our pattern for using ENUM_BF was confusing doxygen by making declarations that didn't look like declarations.
2014-03-10Throw control port warning if we failed to connect to all our bridges.George Kadianakis
2013-10-29Merge remote-tracking branch 'public/bug5018'Nick Mathewson
Conflicts: src/or/entrynodes.c
2013-10-29Only launch transport proxies that provide useful transports.George Kadianakis