diff options
author | Isis Lovecruft <isis@torproject.org> | 2018-03-05 20:43:26 +0000 |
---|---|---|
committer | Isis Lovecruft <isis@torproject.org> | 2018-04-09 19:32:46 +0000 |
commit | c2c5b13e5d8a77eeee36028940175f182fda1ec9 (patch) | |
tree | fc648e2f5f9f82f443dd705dc1ac02f71cdd900e /src/or/bridges.h | |
parent | 54e25ab124b4ebb50f1577483ac5c08f67e8b114 (diff) | |
download | tor-c2c5b13e5d8a77eeee36028940175f182fda1ec9.tar.gz tor-c2c5b13e5d8a77eeee36028940175f182fda1ec9.zip |
test: Add testing module and some unittests for bridges.c.
This roughly doubles our test coverage of the bridges.c module.
* ADD new testing module, .../src/test/test_bridges.c.
* CHANGE a few function declarations from `static` to `STATIC`.
* CHANGE one function in transports.c, transport_get_by_name(), to be
mockable.
* CLOSES #25425: https://bugs.torproject.org/25425
Diffstat (limited to 'src/or/bridges.h')
-rw-r--r-- | src/or/bridges.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/or/bridges.h b/src/or/bridges.h index 54a6250259..3108eb555d 100644 --- a/src/or/bridges.h +++ b/src/or/bridges.h @@ -20,7 +20,6 @@ typedef struct bridge_info_t bridge_info_t; void mark_bridge_list(void); void sweep_bridge_list(void); const smartlist_t *bridge_list_get(void); -bridge_info_t *find_bridge_by_digest(const char *digest); const uint8_t *bridge_get_rsa_id_digest(const bridge_info_t *bridge); const tor_addr_port_t * bridge_get_addr_port(const bridge_info_t *bridge); bridge_info_t *get_configured_bridge_by_addr_port_digest( @@ -65,5 +64,17 @@ MOCK_DECL(download_status_t *, get_bridge_dl_status_by_id, void bridges_free_all(void); +#ifdef TOR_BRIDGES_PRIVATE +STATIC void clear_bridge_list(void); +STATIC bridge_info_t *find_bridge_by_digest(const char *digest); +STATIC bridge_info_t *get_configured_bridge_by_orports_digest( + const char *digest, + const smartlist_t *orports); +STATIC void bridge_resolve_conflicts(const tor_addr_t *addr, + uint16_t port, + const char *digest, + const char *transport_name); +#endif /* defined(TOR_BRIDGES_PRIVATE) */ + #endif /* !defined(TOR_BRIDGES_H) */ |