diff options
author | AmreshVenugopal <amresh.venugopal@gmail.com> | 2019-09-17 00:11:18 +0530 |
---|---|---|
committer | teor <teor@torproject.org> | 2019-10-21 13:54:55 +1000 |
commit | 6413b2102f4ac968092a6b1bc58b78d4bb7f90de (patch) | |
tree | 9cbe813f849e1db7685f8d94b839f5e4c164247c /src/feature/nodelist | |
parent | 6846d14868b561e51e5f6afc27a1f1e8a0da94ce (diff) | |
download | tor-6413b2102f4ac968092a6b1bc58b78d4bb7f90de.tar.gz tor-6413b2102f4ac968092a6b1bc58b78d4bb7f90de.zip |
control: Add GETINFO support for dumping microdesc consensus
- Allows control port to read microdesc consensus using:
GETINFO dir/status-vote/microdesc/consensus
add: Helper function `getinfo_helper_current_consensus`
test: check if GETINFO commands return expected consensus data.
Resolves 31684.
Diffstat (limited to 'src/feature/nodelist')
-rw-r--r-- | src/feature/nodelist/networkstatus.c | 8 | ||||
-rw-r--r-- | src/feature/nodelist/networkstatus.h | 3 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/feature/nodelist/networkstatus.c b/src/feature/nodelist/networkstatus.c index 496bafb865..b4b98301b0 100644 --- a/src/feature/nodelist/networkstatus.c +++ b/src/feature/nodelist/networkstatus.c @@ -216,10 +216,10 @@ networkstatus_reset_download_failures(void) } /** Return the filename used to cache the consensus of a given flavor */ -static char * -networkstatus_get_cache_fname(int flav, - const char *flavorname, - int unverified_consensus) +MOCK_IMPL(char *, +networkstatus_get_cache_fname,(int flav, + const char *flavorname, + int unverified_consensus)) { char buf[128]; const char *prefix; diff --git a/src/feature/nodelist/networkstatus.h b/src/feature/nodelist/networkstatus.h index 600fd7fbd5..e2c6ba611a 100644 --- a/src/feature/nodelist/networkstatus.h +++ b/src/feature/nodelist/networkstatus.h @@ -16,6 +16,9 @@ void networkstatus_reset_warnings(void); void networkstatus_reset_download_failures(void); +MOCK_DECL(char *,networkstatus_get_cache_fname,(int flav, + const char *flavorname, + int unverified_consensus)); tor_mmap_t *networkstatus_map_cached_consensus(const char *flavorname); int router_reload_consensus_networkstatus(void); void routerstatus_free_(routerstatus_t *rs); |