diff options
author | Nick Mathewson <nickm@torproject.org> | 2013-03-18 15:17:11 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2013-03-18 15:17:11 -0400 |
commit | 5959d1c10581399efb46eeb6c0de66547894ed65 (patch) | |
tree | 81f75fa6923b5810538b9f150f228428ca01501e /src/or/dirserv.h | |
parent | 3f837d4826cce0e7917e79d73b81aefc3fefc6bd (diff) | |
parent | 0164f16f70d17da202c8085e620e9cf043eda0b3 (diff) | |
download | tor-5959d1c10581399efb46eeb6c0de66547894ed65.tar.gz tor-5959d1c10581399efb46eeb6c0de66547894ed65.zip |
Merge remote-tracking branch 'andrea/bug8435' into maint-0.2.4
Diffstat (limited to 'src/or/dirserv.h')
-rw-r--r-- | src/or/dirserv.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/or/dirserv.h b/src/or/dirserv.h index 0f8cb4150e..a84ae964c9 100644 --- a/src/or/dirserv.h +++ b/src/or/dirserv.h @@ -137,10 +137,23 @@ void cached_dir_decref(cached_dir_t *d); cached_dir_t *new_cached_dir(char *s, time_t published); #ifdef DIRSERV_PRIVATE + +/* Put the MAX_MEASUREMENT_AGE #define here so unit tests can see it */ +#define MAX_MEASUREMENT_AGE (3*24*60*60) /* 3 days */ + int measured_bw_line_parse(measured_bw_line_t *out, const char *line); int measured_bw_line_apply(measured_bw_line_t *parsed_line, smartlist_t *routerstatuses); + +void dirserv_cache_measured_bw(const measured_bw_line_t *parsed_line, + time_t as_of); +void dirserv_clear_measured_bw_cache(void); +void dirserv_expire_measured_bw_cache(time_t now); +int dirserv_get_measured_bw_cache_size(void); +int dirserv_query_measured_bw_cache(const char *node_id, long *bw_out, + time_t *as_of_out); +int dirserv_has_measured_bw(const char *node_id); #endif int dirserv_read_measured_bandwidths(const char *from_file, |