Stop trying to generate test scripts via autoconf substitution.
[tor.git] / src / or / addressmap.h
blobff108df024c243ea92cfeaeaf970325433bdd553
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-2015, The Tor Project, Inc. */
5 /* See LICENSE for licensing information */
7 #ifndef TOR_ADDRESSMAP_H
8 #define TOR_ADDRESSMAP_H
10 #include "testsupport.h"
12 void addressmap_init(void);
13 void addressmap_clear_excluded_trackexithosts(const or_options_t *options);
14 void addressmap_clear_invalid_automaps(const or_options_t *options);
15 void addressmap_clean(time_t now);
16 void addressmap_clear_configured(void);
17 void addressmap_clear_transient(void);
18 void addressmap_free_all(void);
19 #define AMR_FLAG_USE_IPV4_DNS (1u<<0)
20 #define AMR_FLAG_USE_IPV6_DNS (1u<<1)
21 #define AMR_FLAG_USE_MAPADDRESS (1u<<2)
22 #define AMR_FLAG_USE_AUTOMAP (1u<<3)
23 #define AMR_FLAG_USE_TRACKEXIT (1u<<4)
24 int addressmap_rewrite(char *address, size_t maxlen, unsigned flags,
25 time_t *expires_out,
26 addressmap_entry_source_t *exit_source_out);
27 int addressmap_rewrite_reverse(char *address, size_t maxlen, unsigned flags,
28 time_t *expires_out);
29 int addressmap_have_mapping(const char *address, int update_timeout);
31 void addressmap_register(const char *address, char *new_address,
32 time_t expires, addressmap_entry_source_t source,
33 const int address_wildcard,
34 const int new_address_wildcard);
35 int parse_virtual_addr_network(const char *val,
36 sa_family_t family, int validate_only,
37 char **msg);
38 int client_dns_incr_failures(const char *address);
39 void client_dns_clear_failures(const char *address);
40 void client_dns_set_addressmap(entry_connection_t *for_conn,
41 const char *address, const tor_addr_t *val,
42 const char *exitname, int ttl);
43 const char *addressmap_register_virtual_address(int type, char *new_address);
44 void addressmap_get_mappings(smartlist_t *sl, time_t min_expires,
45 time_t max_expires, int want_expiry);
46 int address_is_in_virtual_range(const char *addr);
47 void clear_trackexithost_mappings(const char *exitname);
48 void client_dns_set_reverse_addressmap(entry_connection_t *for_conn,
49 const char *address, const char *v,
50 const char *exitname, int ttl);
51 int addressmap_address_should_automap(const char *address,
52 const or_options_t *options);
54 #ifdef ADDRESSMAP_PRIVATE
55 typedef struct virtual_addr_conf_t {
56 tor_addr_t addr;
57 maskbits_t bits;
58 } virtual_addr_conf_t;
60 STATIC void get_random_virtual_addr(const virtual_addr_conf_t *conf,
61 tor_addr_t *addr_out);
62 #endif
64 #endif