aboutsummaryrefslogtreecommitdiff
path: root/src/or/networkstatus.c
Commit message (Collapse)AuthorAge
* Rename routerstatus_t.is_running to is_flagged_runningNick Mathewson2010-10-01
| | | | | | | | | | | | This was the only flag in routerstatus_t that we would previously change in a routerstatus_t in a consensus. We no longer have reason to do so -- and probably never did -- as you can now confirm more easily than you could have done by grepping for is_running before this patch. The name change is to emphasize that the routerstatus_t is_running flag is only there to tell you whether the consensus says it's running, not whether it *you* think it's running.
* Initial conversion to use node_t throughout our codebase.Nick Mathewson2010-10-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A node_t is an abstraction over routerstatus_t, routerinfo_t, and microdesc_t. It should try to present a consistent interface to all of them. There should be a node_t for a server whenever there is * A routerinfo_t for it in the routerlist * A routerstatus_t in the current_consensus. (note that a microdesc_t alone isn't enough to make a node_t exist, since microdescriptors aren't usable on their own.) There are three ways to get a node_t right now: looking it up by ID, looking it up by nickname, and iterating over the whole list of microdescriptors. All (or nearly all) functions that are supposed to return "a router" -- especially those used in building connections and circuits -- should return a node_t, not a routerinfo_t or a routerstatus_t. A node_t should hold all the *mutable* flags about a node. This patch moves the is_foo flags from routerinfo_t into node_t. The flags in routerstatus_t remain, but they get set from the consensus and should not change. Some other highlights of this patch are: * Looking up routerinfo and routerstatus by nickname is now unified and based on the "look up a node by nickname" function. This tries to look only at the values from current consensus, and not get confused by the routerinfo_t->is_named flag, which could get set for other weird reasons. This changes the behavior of how authorities (when acting as clients) deal with nodes that have been listed by nickname. * I tried not to artificially increase the size of the diff here by moving functions around. As a result, some functions that now operate on nodes are now in the wrong file -- they should get moved to nodelist.c once this refactoring settles down. This moving should happen as part of a patch that moves functions AND NOTHING ELSE. * Some old code is now left around inside #if 0/1 blocks, and should get removed once I've verified that I don't want it sitting around to see how we used to do things. There are still some unimplemented functions: these are flagged with "UNIMPLEMENTED_NODELIST()." I'll work on filling in the implementation here, piece by piece. I wish this patch could have been smaller, but there did not seem to be any piece of it that was independent from the rest. Moving flags forces many functions that once returned routerinfo_t * to return node_t *, which forces their friends to change, and so on.
* Try to make most routerstatus_t interfaces constNick Mathewson2010-10-01
|
* Try to make most routerinfo_t interfaces constNick Mathewson2010-10-01
|
* Implement a basic node and nodelist typeNick Mathewson2010-10-01
| | | | | | | | | | | | | The node_t type is meant to serve two key functions: 1) Abstracting difference between routerinfo_t and microdesc_t so that clients can use microdesc_t instead of routerinfo_t. 2) Being a central place to hold mutable state about nodes formerly held in routerstatus_t and routerinfo_t. This patch implements a nodelist type that holds a node for every router that we would consider using.
* Clean long-unlisted microdescs from the cacheNick Mathewson2010-09-27
|
* Download microdescriptors if you're a cacheNick Mathewson2010-09-27
| | | | | This commit adds some functions to see what microdescriptors we're missing, and adds fetch-microdesc/store-microdesc logic to the directory code.
* When updating routerdesc downloads, look specifically at the ns consensusNick Mathewson2010-09-27
| | | | | This will be needed when "get_live_consensus" potentially returns a microdesc consensus.
* Code to download, parse, and store microdesc consensusesNick Mathewson2010-09-27
|
* Count unknown authorities as unknown only once, not once per signature.Nick Mathewson2010-09-20
| | | | | | Do not double-report signatures from unrecognized authorities both as "from unknown authority" and "not present". Fixes bug 1956, bugfix on 0.2.2.16-alpha.
* Merge branch 'bug911'Nick Mathewson2010-09-14
|\
| * Tweak some issues found by arma in bug911 review.Nick Mathewson2010-09-14
| |
| * Move code for launching tests out of router_add_to_routerlist()Nick Mathewson2010-08-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | router_add_to_routerlist() is supposed to be a nice minimal function that only touches the routerlist structures, but it included a call to dirserv_single_reachability_test(). We have a function that gets called _after_ adding descriptors successfully: routerlist_descriptors_added. This patch moves the responsibility for testing there. Because the decision of whether to test or not depends on whether there was an old routerinfo for this router or not, we have to first detect whether we _will_ want to run the tests if the router is added. We make this the job of routers_update_status_from_consensus_networkstatus(). Finally, this patch makes the code notice if a router is going from hibernating to non-hibernating, and if so causes a reachability test to get launched.
* | Merge remote branch 'public/pretty-signature-log'Nick Mathewson2010-09-13
|\ \
| * | Complicate the rules on WARN vs INFO in consensus verificationNick Mathewson2010-09-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | It's normal when bootstrapping to have a lot of different certs missing, so we don't want missing certs to make us warn... unless the certs we're missing are ones that we've tried to fetch a couple of times and failed at. May fix bug 1145.
| * | Make the "2 unknown, 7 missing key..." messages easier to understandNick Mathewson2010-08-19
| | | | | | | | | | | | | | | | | | This patch should fix the cases we care about for bugs 1290 and 1145. "30-56-99 are correct. Limited 4 and 8 are missing".
* | | Make authorities download consensuses if appropriateNick Mathewson2010-09-12
|/ / | | | | | | | | | | | | | | An authority should never download a consensus if it has a live one, but when it doesn't, it should admit that it's not going to get one, and see if anybody else can give it one. Fixes 1300, fix on 0.2.0.9-alpha
* | Merge branch 'maint-0.2.1'Nick Mathewson2010-08-17
|\ \ | | | | | | | | | | | | Resolved conflict in src/or/networkstatus.c
| * | Scale CONSENSUS_MIN_SECONDS_BEFORE_CACHING by voting intervalNick Mathewson2010-08-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the voting interval was short enough, the two-minutes delay of CONSENSUS_MIN_SECONDS_BEFORE_CACHING would confuse bridges to the point where they would assert before downloading a consensus. It it was even shorter (<4 minutes, I think), caches would assert too. This patch fixes that by having replacing the two-minutes value with MIN(2 minutes, interval/16). Bugfix for 1141; the cache bug could occur since 0.2.0.8-alpha, so I'm calling this a bugfix on that. Robert Hogan diagnosed this. Done as a patch against maint-0.2.1, since it makes it hard to run some kinds of testing networks.
* | | reinit per-conn token buckets on config or consensus changeRoger Dingledine2010-08-15
| | |
* | | fix a memory leak introduced by df1ef2f0f0856afRoger Dingledine2010-08-13
| |/ |/|
* | Create routerparse.hSebastian Hahn2010-07-27
| |
* | Create relay.hSebastian Hahn2010-07-27
| |
* | Create networkstatus.hSebastian Hahn2010-07-27
| |
* | Create dirvote.hSebastian Hahn2010-07-27
| |
* | Create dirserv.hSebastian Hahn2010-07-27
| |
* | Create directory.hSebastian Hahn2010-07-27
| |
* | Create control.hSebastian Hahn2010-07-27
| |
* | Create connection.hSebastian Hahn2010-07-27
| |
* | Create config.hSebastian Hahn2010-07-27
| |
* | Create circuitbuild.hSebastian Hahn2010-07-27
| |
* | Create routerlist.hSebastian Hahn2010-07-27
| |
* | Create router.hSebastian Hahn2010-07-27
| |
* | Fix getinfo_helper_networkstatus to return 0 on question-not-knownNick Mathewson2010-07-18
| | | | | | | | | | It erroneously returned -1 instead, which made it say "Internal error" rather than "Unrecognized key."
* | Make the controller act more usefully when GETINFO failsNick Mathewson2010-07-18
| | | | | | | | | | | | | | | | | | | | | | Right now it says "552 internal error" because there's no way for getinfo_helper_*() countries to specify an error message. This patch changes the getinfo_helper_*() interface, and makes most of the getinfo helpers give useful error messages in response to failures. This should prevent recurrences of bug 1699, where a missing GeoIPFile line in the torrc made GETINFO ip-to-county/* fail in a "not obvious how to fix" way.
* | Alter how guard flags are chosen.Mike Perry2010-07-14
| | | | | | | | | | | | | | | | V3 authorities no longer decide not to vote on Guard+Exit. The bandwidth weights should take care of this now. Also, lower the max threshold for WFU to 0.98, to allow more nodes to become guards.
* | simplify a path in networkstatusRoger Dingledine2010-04-15
| |
* | Merge remote branch 'origin/maint-0.2.1'Nick Mathewson2010-02-27
|\| | | | | | | | | | | Conflicts: src/common/test.h src/or/test.c
| * Update Tor Project copyright yearsNick Mathewson2010-02-27
| |
| * read the "circwindow" parameter from the consensusRoger Dingledine2009-10-14
| | | | | | | | | | backport of c43859c5c12361fad505 backport of 0d13e0ed145f4c1b5bd1
| * Code to parse and access network parameters.Nick Mathewson2009-10-14
| | | | | | | | | | Partial backport of 381766ce4b1145460. Partial backport of 56c6d78520a98fb64.
* | Remove misc unnecessary newlines found by new check.Mike Perry2010-02-22
| |
* | Add parsing+verification for bw weight values.Mike Perry2010-02-22
| |
* | Perform calculation of consensus bandwidth weights.Mike Perry2010-02-22
| | | | | | | | | | Also add bwweightscale consensus param. Use it as our fixed-point calculation width.
* | Move CBT params into consensus.Mike Perry2010-02-18
| |
* | Merge branch 'ewma'Nick Mathewson2009-12-18
|\ \
| * | Change interface for configuring cell ewma algorithm.Nick Mathewson2009-12-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The rule is now: take the value from the CircuitPriorityHalflife config option if it is set. If it zero, disable the cell_ewma algorithm. If it is set, use it to calculate the scaling factor. If it is not set, look for a CircPriorityHalflifeMsec parameter in the consensus networkstatus. If *that* is zero, then disable the cell_ewma algorithm; if it is set, use it to calculate the scaling factor. If it is not set at all, disable the algorithm.
* | | Fix compile warning on Panther.Sebastian Hahn2009-12-14
| | | | | | | | | | | | Apparently Panther doesn't like comparing ints and enums
* | | New controller command "getinfo config-text"Roger Dingledine2009-12-13
|/ / | | | | | | | | It returns the contents that Tor would write if you send it a SAVECONF command, so the controller can write the file to disk itself.
* | Now that FOO_free(NULL) always works, remove checks before calling it.Nick Mathewson2009-12-12
| |