Go to the documentation of this file.
1 /* Copyright (c) 2001 Matej Pfajfar.
2  * Copyright (c) 2001-2004, Roger Dingledine.
3  * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
4  * Copyright (c) 2007-2019, The Tor Project, Inc. */
5 /* See LICENSE for licensing information */
12 #ifndef TOR_BRIDGES_H
13 #define TOR_BRIDGES_H
15 struct bridge_line_t;
18 /* Opaque handle to a configured bridge */
19 typedef struct bridge_info_t bridge_info_t;
21 void mark_bridge_list(void);
22 void sweep_bridge_list(void);
23 const smartlist_t *bridge_list_get(void);
24 const uint8_t *bridge_get_rsa_id_digest(const bridge_info_t *bridge);
27  const tor_addr_t *addr,
28  uint16_t port,
29  const char *digest);
31  const tor_addr_t *addr,
32  uint16_t port,
33  const char *digest);
35 int addr_is_a_configured_bridge(const tor_addr_t *addr, uint16_t port,
36  const char *digest);
39 int node_is_a_configured_bridge(const node_t *node);
40 void learned_router_identity(const tor_addr_t *addr, uint16_t port,
41  const char *digest,
42  const struct ed25519_public_key_t *ed_id);
44 void bridge_add_from_config(struct bridge_line_t *bridge_line);
45 void retry_bridge_descriptor_fetch_directly(const char *digest);
46 void fetch_bridge_descriptors(const or_options_t *options, time_t now);
47 void learned_bridge_descriptor(routerinfo_t *ri, int from_cache);
49  uint16_t port);
51 int any_bridges_dont_support_microdescriptors(void);
54  uint16_t port);
55 struct transport_t;
57  const struct transport_t **transport);
59 MOCK_DECL(int, transport_is_needed, (const char *transport_name));
60 int validate_pluggable_transports_config(void);
62 MOCK_DECL(smartlist_t *, list_bridge_identities, (void));
63 MOCK_DECL(download_status_t *, get_bridge_dl_status_by_id,
64  (const char *digest));
66 void bridges_free_all(void);
69 STATIC void clear_bridge_list(void);
70 STATIC bridge_info_t *find_bridge_by_digest(const char *digest);
72  const char *digest,
73  const smartlist_t *orports);
74 STATIC void bridge_resolve_conflicts(const tor_addr_t *addr,
75  uint16_t port,
76  const char *digest,
77  const char *transport_name);
78 #endif /* defined(TOR_BRIDGES_PRIVATE) */
80 #endif /* !defined(TOR_BRIDGES_H) */
bridge_info_t * get_configured_bridge_by_addr_port_digest(const tor_addr_t *addr, uint16_t port, const char *digest)
Definition: bridges.c:200
uint16_t port
Definition: transports.h:26
bridge_info_t * get_configured_bridge_by_exact_addr_port_digest(const tor_addr_t *addr, uint16_t port, const char *digest)
Definition: bridges.c:226
Definition: node_st.h:28
const tor_addr_port_t * bridge_get_addr_port(const bridge_info_t *bridge)
Definition: bridges.c:161
void learned_router_identity(const tor_addr_t *addr, uint16_t port, const char *digest, const ed25519_public_key_t *ed_id)
Definition: bridges.c:397
void sweep_bridge_list(void)
Definition: bridges.c:95
const smartlist_t * get_socks_args_by_bridge_addrport(const tor_addr_t *addr, uint16_t port)
Definition: bridges.c:644
STATIC void bridge_resolve_conflicts(const tor_addr_t *addr, uint16_t port, const char *digest, const char *transport_name)
Definition: bridges.c:454
const uint8_t * bridge_get_rsa_id_digest(const bridge_info_t *bridge)
Definition: bridges.c:147
void bridges_free_all(void)
Definition: bridges.c:1025
int extend_info_is_a_configured_bridge(const extend_info_t *ei)
Definition: bridges.c:264
void retry_bridge_descriptor_fetch_directly(const char *digest)
Definition: bridges.c:709
void learned_bridge_descriptor(routerinfo_t *ri, int from_cache)
Definition: bridges.c:937
void bridge_add_from_config(struct bridge_line_t *bridge_line)
Definition: bridges.c:521
tor_addr_t addr
Definition: bridges.c:47
STATIC bridge_info_t * get_configured_bridge_by_orports_digest(const char *digest, const smartlist_t *orports)
Definition: bridges.c:172
int addr_is_a_configured_bridge(const tor_addr_t *addr, uint16_t port, const char *digest)
Definition: bridges.c:251
const char * find_transport_name_by_bridge_addrport(const tor_addr_t *addr, uint16_t port)
Definition: bridges.c:591
STATIC void clear_bridge_list(void)
Definition: bridges.c:109
int routerinfo_is_a_configured_bridge(const routerinfo_t *ri)
Definition: bridges.c:286
const smartlist_t * bridge_list_get(void)
Definition: bridges.c:135
int node_is_a_configured_bridge(const node_t *node)
Definition: bridges.c:348
void mark_bridge_list(void)
Definition: bridges.c:84
#define MOCK_DECL(rv, funcname, arglist)
Definition: testsupport.h:94
void fetch_bridge_descriptors(const or_options_t *options, time_t now)
Definition: bridges.c:722
STATIC bridge_info_t * find_bridge_by_digest(const char *digest)
Definition: bridges.c:575
tor_addr_t addr
Definition: transports.h:24
int get_transport_by_bridge_addrport(const tor_addr_t *addr, uint16_t port, const transport_t **transport)
Definition: bridges.c:614
uint16_t port
Definition: bridges.c:49