diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-09-08 11:54:24 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-11-30 14:08:11 -0500 |
commit | 69d16900aaf1d54b44d2b28514a09873154c63d3 (patch) | |
tree | dae8d76b14f99e94af2291fab286dc47100a5710 /src/or/connection_edge.h | |
parent | df0da3991cb00efdf7c9362e805877e63ce8a46e (diff) | |
download | tor-69d16900aaf1d54b44d2b28514a09873154c63d3.tar.gz tor-69d16900aaf1d54b44d2b28514a09873154c63d3.zip |
Refactor addressmap_match_superdomains and representation of wildcards
In this new representation for wildcarded addresses, there are no
longer any 'magic addresses': rather, "a.b c.d", "*.a.b c.d" and
"*.a.b *.c.d" are all represented by a mapping from "a.b" to "c.d". we
now distinguish them by setting bits in the addressmap_entry_t
structure, where src_wildcard is set if the source address had a
wildcard, and dst_wildcard is set if the target address had a
wildcard.
This lets the case where "*.a.b *.c.d" or "*.a.b c.d" remap the
address "a.b" get handled trivially, and lets us simplify and improve
the addressmap_match_superdomains implementation: we can now have it
run in O(parts of address) rather than O(entries in addressmap).
Diffstat (limited to 'src/or/connection_edge.h')
-rw-r--r-- | src/or/connection_edge.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/or/connection_edge.h b/src/or/connection_edge.h index 830667e601..47c9c45b1a 100644 --- a/src/or/connection_edge.h +++ b/src/or/connection_edge.h @@ -78,7 +78,8 @@ int addressmap_rewrite(char *address, size_t maxlen, time_t *expires_out); int addressmap_have_mapping(const char *address, int update_timeout); void addressmap_register(const char *address, char *new_address, - time_t expires, addressmap_entry_source_t source); + time_t expires, addressmap_entry_source_t source, + int address_wildcard, int new_address_wildcard); int parse_virtual_addr_network(const char *val, int validate_only, char **msg); int client_dns_incr_failures(const char *address); |