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.c | |
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.c')
-rw-r--r-- | src/or/circuitbuild.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index 68ff964f62..74e607d18f 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -72,10 +72,7 @@ static channel_t * channel_connect_for_circuit(const tor_addr_t *addr, static int circuit_deliver_create_cell(circuit_t *circ, const create_cell_t *create_cell, int relayed); -static int onion_pick_cpath_exit(origin_circuit_t *circ, extend_info_t *exit, - int is_hs_v3_rp_circuit); static crypt_path_t *onion_next_hop_in_cpath(crypt_path_t *cpath); -static int onion_extend_cpath(origin_circuit_t *circ); STATIC int onion_append_hop(crypt_path_t **head_ptr, extend_info_t *choice); static int circuit_send_first_onion_skin(origin_circuit_t *circ); static int circuit_build_no_more_hops(origin_circuit_t *circ); @@ -2285,7 +2282,7 @@ warn_if_last_router_excluded(origin_circuit_t *circ, * be used as an HS v3 rendezvous point. * * Return 0 if ok, -1 if circuit should be closed. */ -static int +STATIC int onion_pick_cpath_exit(origin_circuit_t *circ, extend_info_t *exit_ei, int is_hs_v3_rp_circuit) { @@ -2719,7 +2716,7 @@ onion_next_hop_in_cpath(crypt_path_t *cpath) * Return 1 if the path is complete, 0 if we successfully added a hop, * and -1 on error. */ -static int +STATIC int onion_extend_cpath(origin_circuit_t *circ) { uint8_t purpose = circ->base_.purpose; |