12 #ifndef TOR_ADDRESSMAP_H
13 #define TOR_ADDRESSMAP_H
24 #define AMR_FLAG_USE_IPV4_DNS (1u<<0)
25 #define AMR_FLAG_USE_IPV6_DNS (1u<<1)
26 #define AMR_FLAG_USE_MAPADDRESS (1u<<2)
27 #define AMR_FLAG_USE_AUTOMAP (1u<<3)
28 #define AMR_FLAG_USE_TRACKEXIT (1u<<4)
38 const int address_wildcard,
39 const int new_address_wildcard, uint64_t stream_id);
47 const char *exitname,
int ttl);
50 time_t max_expires,
int want_expiry);
54 const char *address,
const char *v,
55 const char *exitname,
int ttl);
59 #ifdef ADDRESSMAP_PRIVATE
60 typedef struct virtual_addr_conf_t {
63 } virtual_addr_conf_t;
STATIC void get_random_virtual_addr(const virtual_addr_conf_t *conf, tor_addr_t *addr_out)
void addressmap_init(void)
int address_is_in_virtual_range(const char *addr)
void client_dns_set_reverse_addressmap(entry_connection_t *for_conn, const char *address, const char *v, const char *exitname, int ttl)
void clear_trackexithost_mappings(const char *exitname)
void addressmap_register(const char *address, char *new_address, time_t expires, addressmap_entry_source_t source, const int address_wildcard, const int new_address_wildcard, uint64_t stream_id)
void addressmap_get_mappings(smartlist_t *sl, time_t min_expires, time_t max_expires, int want_expiry)
void addressmap_clear_invalid_automaps(const or_options_t *options)
int addressmap_have_mapping(const char *address, int update_timeout)
void addressmap_clean(time_t now)
int client_dns_incr_failures(const char *address)
void client_dns_set_addressmap(entry_connection_t *for_conn, const char *address, const tor_addr_t *val, const char *exitname, int ttl)
int addressmap_rewrite(char *address, size_t maxlen, unsigned flags, time_t *expires_out, addressmap_entry_source_t *exit_source_out)
void addressmap_free_all(void)
int addressmap_address_should_automap(const char *address, const or_options_t *options)
void client_dns_clear_failures(const char *address)
const char * addressmap_register_virtual_address(int type, char *new_address)
void addressmap_clear_configured(void)
void addressmap_clear_transient(void)
void addressmap_clear_excluded_trackexithosts(const or_options_t *options)
int parse_virtual_addr_network(const char *val, sa_family_t family, int validate_only, char **msg)
int addressmap_rewrite_reverse(char *address, size_t maxlen, unsigned flags, time_t *expires_out)
addressmap_entry_source_t
Macros to implement mocking and selective exposure for the test code.