2016-11-15 13:49:06 +01:00
|
|
|
/* Copyright (c) 2001 Matej Pfajfar.
|
|
|
|
* Copyright (c) 2001-2004, Roger Dingledine.
|
|
|
|
* Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
|
2017-03-15 21:13:17 +01:00
|
|
|
* Copyright (c) 2007-2017, The Tor Project, Inc. */
|
2016-11-15 13:49:06 +01:00
|
|
|
/* See LICENSE for licensing information */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \file bridges.h
|
|
|
|
* \brief Header file for circuitbuild.c.
|
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef TOR_BRIDGES_H
|
|
|
|
#define TOR_BRIDGES_H
|
|
|
|
|
|
|
|
struct bridge_line_t;
|
|
|
|
|
2016-11-29 14:04:41 +01:00
|
|
|
/* Opaque handle to a configured bridge */
|
|
|
|
typedef struct bridge_info_t bridge_info_t;
|
|
|
|
|
2016-11-15 13:49:06 +01:00
|
|
|
void mark_bridge_list(void);
|
|
|
|
void sweep_bridge_list(void);
|
2016-11-29 14:04:41 +01:00
|
|
|
const smartlist_t *bridge_list_get(void);
|
2016-11-29 16:14:42 +01:00
|
|
|
bridge_info_t *find_bridge_by_digest(const char *digest);
|
2016-11-29 14:04:41 +01:00
|
|
|
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);
|
2016-11-29 16:14:42 +01:00
|
|
|
bridge_info_t *get_configured_bridge_by_addr_port_digest(
|
|
|
|
const tor_addr_t *addr,
|
|
|
|
uint16_t port,
|
|
|
|
const char *digest);
|
2017-02-14 18:21:31 +01:00
|
|
|
bridge_info_t *get_configured_bridge_by_exact_addr_port_digest(
|
|
|
|
const tor_addr_t *addr,
|
|
|
|
uint16_t port,
|
|
|
|
const char *digest);
|
2016-11-15 13:49:06 +01:00
|
|
|
|
|
|
|
int addr_is_a_configured_bridge(const tor_addr_t *addr, uint16_t port,
|
|
|
|
const char *digest);
|
|
|
|
int extend_info_is_a_configured_bridge(const extend_info_t *ei);
|
|
|
|
int routerinfo_is_a_configured_bridge(const routerinfo_t *ri);
|
|
|
|
int node_is_a_configured_bridge(const node_t *node);
|
|
|
|
void learned_router_identity(const tor_addr_t *addr, uint16_t port,
|
2016-12-16 17:20:59 +01:00
|
|
|
const char *digest,
|
|
|
|
const ed25519_public_key_t *ed_id);
|
2016-11-15 13:49:06 +01:00
|
|
|
|
|
|
|
void bridge_add_from_config(struct bridge_line_t *bridge_line);
|
|
|
|
void retry_bridge_descriptor_fetch_directly(const char *digest);
|
|
|
|
void fetch_bridge_descriptors(const or_options_t *options, time_t now);
|
|
|
|
void learned_bridge_descriptor(routerinfo_t *ri, int from_cache);
|
|
|
|
const smartlist_t *get_socks_args_by_bridge_addrport(const tor_addr_t *addr,
|
|
|
|
uint16_t port);
|
|
|
|
|
|
|
|
int any_bridges_dont_support_microdescriptors(void);
|
|
|
|
|
|
|
|
const char *find_transport_name_by_bridge_addrport(const tor_addr_t *addr,
|
|
|
|
uint16_t port);
|
|
|
|
struct transport_t;
|
|
|
|
int get_transport_by_bridge_addrport(const tor_addr_t *addr, uint16_t port,
|
|
|
|
const struct transport_t **transport);
|
|
|
|
|
|
|
|
MOCK_DECL(int, transport_is_needed, (const char *transport_name));
|
|
|
|
int validate_pluggable_transports_config(void);
|
|
|
|
|
|
|
|
MOCK_DECL(smartlist_t *, list_bridge_identities, (void));
|
|
|
|
MOCK_DECL(download_status_t *, get_bridge_dl_status_by_id,
|
|
|
|
(const char *digest));
|
|
|
|
|
|
|
|
void bridges_free_all(void);
|
|
|
|
|
2017-09-15 22:24:44 +02:00
|
|
|
#endif /* !defined(TOR_BRIDGES_H) */
|
2016-11-15 13:49:06 +01:00
|
|
|
|