diff options
author | Nick Mathewson <nickm@torproject.org> | 2013-02-04 13:44:05 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2013-02-04 13:44:05 -0500 |
commit | cd4ad45ba31f4ae08aa185f358ee56721a06170b (patch) | |
tree | b2ab06cca25a182ecb851a153c6fed01638163d2 /src/or/dirserv.c | |
parent | 12f2d986f327de281cb70377a7cf926b0f40f4e4 (diff) | |
download | tor-cd4ad45ba31f4ae08aa185f358ee56721a06170b.tar.gz tor-cd4ad45ba31f4ae08aa185f358ee56721a06170b.zip |
Include a flag-thresholds line in each vote to describe flag cutoffs
Implements ticket 8151.
Diffstat (limited to 'src/or/dirserv.c')
-rw-r--r-- | src/or/dirserv.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c index b59478e17d..6209842881 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -2059,6 +2059,30 @@ dirserv_compute_performance_thresholds(routerlist_t *rl, tor_free(wfus); } +/** Give a statement of our current performance thresholds for inclusion + * in a vote document. */ +char * +dirserv_get_flag_thresholds_line(void) +{ + char *result=NULL; + tor_asprintf(&result, + "stable-uptime=%lu stable-mtbf=%lu " + "fast-speed=%lu " + "guard-wfu=%.03f%% guard-tk=%lu " + "guard-bw-inc-exits=%lu guard-bw-exc-exits=%lu " + "enough-mtbf=%d", + (unsigned long)stable_uptime, + (unsigned long)stable_mtbf, + (unsigned long)fast_bandwidth, + guard_wfu*100, + (unsigned long)guard_tk, + (unsigned long)guard_bandwidth_including_exits, + (unsigned long)guard_bandwidth_excluding_exits, + enough_mtbf_info ? 1 : 0); + + return result; +} + /** Given a platform string as in a routerinfo_t (possibly null), return a * newly allocated version string for a networkstatus document, or NULL if the * platform doesn't give a Tor version. */ |