summaryrefslogtreecommitdiff
path: root/src/or/rephist.c
AgeCommit message (Collapse)Author
2011-03-11Merge remote branch 'origin/maint-0.2.2'Nick Mathewson
2011-03-11Clarify threat description and avoid negative uptimes.Nick Mathewson
2011-03-11Use observed instead of declared uptime for HSDirSebastian Hahn
It is important to verify the uptime claim of a relay instead of just trusting it, otherwise it becomes too easy to blackhole a specific hidden service. rephist already has data available that we can use here. Bugfix on 0.2.0.10-alpha.
2011-03-08Merge remote branch 'origin/maint-0.2.2'Nick Mathewson
Resolved trivial one-line conflicts. Conflicts: src/or/dirserv.c src/or/rephist.c
2011-03-08Merge remote branch 'sebastian/bug1035' into maint-0.2.2Nick Mathewson
2011-03-01Merge remote branch 'origin/maint-0.2.2'Nick Mathewson
2011-03-01Avoid spurious bwhist parsing failuresNick Mathewson
This should fix a bug that special ran into, where if your state file didn't record period maxima, it would never decide that it had successfully parsed itself unless you got lucky with your uninitialized-variable values. This patch also tries to improve error messags in the case where a maximum value legitimately doesn't parse.
2011-02-26clarify an assertSebastian Hahn
also log about running changes, even on a bridge authority.
2011-02-25Merge remote branch 'origin/maint-0.2.2'Nick Mathewson
2011-02-24Fix two potential bugs in the bug1863 code.Karsten Loesing
2011-02-08Routers count as down when they change ORPort, tooSebastian Hahn
rransom noticed that a change of ORPort is just as bad as a change of IP address from a client's perspective, because both mean that the relay is not available to them while the new information hasn't propagated. Change the bug1035 fix accordingly. Also make sure we don't log a bridge's IP address (which might happen when we are the bridge authority).
2011-02-07Fix spelling and an unused #defineSebastian Hahn
both noticed by rransom
2011-01-10fix some spelling in rephist commentsNick Mathewson
2011-01-10Add Maxima lists to bandwidth state.Nick Mathewson
Right now, Tor routers don't save the maxima values from the bw_history_t between sessions. That's no good, since we use those values to determine bandwidth. This code adds a new BWHist.*Maximum set of values to the state file. If they're not present, we estimate them by taking the observed total bandwidth and dividing it by the period length, which provides a lower bound. This should fix bug 1863. I'm calling it a feature.
2011-01-10On bwhist state load failure, clear dir_read/write hist tooNick Mathewson
2011-01-10Fix bug when parsing bwhist with unexpected IntervalNick Mathewson
Previously, our state parsing code would fail to parse a bwhist correctly if the Interval was anything other than the default hardcoded 15 minutes. This change makes the parsing less incorrect, though the resulting history array might get strange values in it if the intervals don't match the one we're using. (That is, if stuff was generated in 15 minute intervals, and we read it into an array that expects 30 minute intervals, we're fine, since values can be combined pairwise. But if we generate data at 30 minute intervals and read it into 15 minute intervals, alternating buckets will be empty.) Bugfix on 0.1.1.11-alpha.
2011-01-10Turn the loop bodies of rep_hist_save/load_state into functionsNick Mathewson
The trick of looping from i=0..4 , switching on i to set up some variables, then running some common code is much better expressed by just calling a function 4 times with 4 sets of arguments. This should make the code a little easier to follow and maintain here.
2011-01-03Add a note about _compare_int not doing overflow rightNick Mathewson
2011-01-03Fix a wide line in rephist.cNick Mathewson
2011-01-03Merge remote branch 'origin/maint-0.2.2'Nick Mathewson
2011-01-03Fix a function formatting warning in rephist.cNick Mathewson
2011-01-03Merge remote branch 'origin/maint-0.2.2'Nick Mathewson
2011-01-03Merge remote branch 'origin/maint-0.2.1' into maint-0.2.2Nick Mathewson
Conflicts: src/common/test.h src/or/test.c
2011-01-03Bump copyright statements to 2011Nick Mathewson
2010-12-27Fix compile without warnings on OS X 10.6Sebastian Hahn
2010-12-03Write bidirectional connection stats in single line.Karsten Loesing
There's no need to have a separate line conn-stats-end for the end date and interval length with only a single line conn-bi-direct following.
2010-12-03Refactor conn stats and add unit tests.Karsten Loesing
2010-12-03Document BIDI_* constants.Karsten Loesing
2010-12-03Add metric on uni/bidirectional connection usage.Karsten Loesing
2010-11-29Merge remote branch 'origin/maint-0.2.2'Nick Mathewson
2010-11-29comment karsten's bug2196 patch a littleNick Mathewson
2010-11-24Report only the top 10 ports in exit-port stats.Karsten Loesing
2010-11-22Handle negative run lengths in wfu/mtbf calculationsNick Mathewson
2010-11-22Treat routers whose IPs have changed as having been down for MTBF/routerinfoNick Mathewson
calculation purposes.
2010-11-19Merge remote branch 'origin/maint-0.2.2'Nick Mathewson
Conflicts: src/or/router.c
2010-11-15Try harder not to exceed the 50 KB extra-info descriptor limit.Karsten Loesing
Our checks that we don't exceed the 50 KB size limit of extra-info descriptors apparently failed. This patch fixes these checks and reserves another 250 bytes for appending the signature. Fixes bug 2183.
2010-11-11Merge remote branch 'public/refactor_pports'Nick Mathewson
2010-10-15Remove an unused field from circ_buffer_stats_tNick Mathewson
2010-10-15Make the predicted ports logic a little simpler.Nick Mathewson
Mainly, this comes from turning two lists that needed to be kept in synch into a single list of structs. This should save a little RAM, and make the code simpler.
2010-10-15Fold timestamp_created into highres_createdNick Mathewson
There's no reason to keep a time_t and a struct timeval to represent the same value: highres_created.tv_sec was the same as timestamp_created. This should save a few bytes per circuit.
2010-10-14Rename router_get_by_digest()Sebastian Hahn
We now call the function router_get_by_id_digest() to make clear that we're talking about the identity digest here, not descriptor digest.
2010-10-01Implement a few more node-based functionsNick Mathewson
Some of these functions only work for routerinfo-based nodes, and as such are only usable for advisory purposes. Fortunately, our uses of them are compatible with this limitation.
2010-10-01Initial conversion to use node_t throughout our codebase.Nick Mathewson
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.
2010-10-01Try to make most routerinfo_t interfaces constNick Mathewson
2010-08-18Merge commit 'karsten/dirbytes2'Nick Mathewson
Conflicts: src/or/rephist.h
2010-08-18Count bytes we spend on answering directory requests.Karsten Loesing
2010-08-15Give rep_hist_exit_stats_history() a better name.Karsten Loesing
2010-08-15Fix memory leak spotted by Nick.Karsten Loesing
2010-08-11Refactor exit port statistics code and add unit tests.Karsten Loesing
2010-08-05Move exit-stats code to the end of rephist.c.Karsten Loesing