diff options
author | George Kadianakis <desnacked@riseup.net> | 2018-04-27 15:27:17 +0300 |
---|---|---|
committer | Mike Perry <mikeperry-git@torproject.org> | 2018-05-01 00:59:27 +0000 |
commit | 627d2fdbf0903498807fdd21c59a91502d731f7d (patch) | |
tree | 934162014476d57b8fcb1524cd94fc816583a7db /src/or/circuitbuild.h | |
parent | 98dea0bc638e6338b7a1c5d84fcc4b4e7455ded2 (diff) | |
download | tor-627d2fdbf0903498807fdd21c59a91502d731f7d.tar.gz tor-627d2fdbf0903498807fdd21c59a91502d731f7d.zip |
Write unittests to check basic vanguard path selection.
Adds two unittests:
- First checks the path selection of basic Tor circs.
- Second checks the path selection of vanguard circs.
There is a TODO on the second unittest that we might want to test sooner than
later, but it's not trivial to do it right now.
To do these unittests we needed the following mods:
- Make some functions STATIC.
- Add some more fields to the big fake network nodes of test_entrynodes.c
- Switch fake node nicknames to base32 (because base64 does not produce valid nicknames).
Diffstat (limited to 'src/or/circuitbuild.h')
-rw-r--r-- | src/or/circuitbuild.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/or/circuitbuild.h b/src/or/circuitbuild.h index bea31ad0dd..ae4aef768a 100644 --- a/src/or/circuitbuild.h +++ b/src/or/circuitbuild.h @@ -83,6 +83,13 @@ STATIC circid_t get_unique_circ_id_by_chan(channel_t *chan); STATIC int new_route_len(uint8_t purpose, extend_info_t *exit_ei, smartlist_t *nodes); MOCK_DECL(STATIC int, count_acceptable_nodes, (smartlist_t *nodes)); + +STATIC int onion_extend_cpath(origin_circuit_t *circ); + +STATIC int +onion_pick_cpath_exit(origin_circuit_t *circ, extend_info_t *exit_ei, + int is_hs_v3_rp_circuit); + #if defined(ENABLE_TOR2WEB_MODE) || defined(TOR_UNIT_TESTS) STATIC const node_t *pick_tor2web_rendezvous_node(router_crn_flags_t flags, const or_options_t *options); |