Skip to content
  • Nick Mathewson's avatar
    Refactor addressmap_match_superdomains and representation of wildcards · 69d16900
    Nick Mathewson authored
    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).
    69d16900