diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-07-15 12:31:09 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-07-15 12:31:09 -0400 |
commit | 3380dc9cc0a8cdaae0dbd3e8b7c11e4ccdab504d (patch) | |
tree | 7753260d960277ee842e6fc731f5bc581feddff3 /src | |
parent | 44cfa538731079ffd6eb5f80b2e3c19c4f8acf03 (diff) | |
download | tor-3380dc9cc0a8cdaae0dbd3e8b7c11e4ccdab504d.tar.gz tor-3380dc9cc0a8cdaae0dbd3e8b7c11e4ccdab504d.zip |
Remove compare_addr_to_addr_policy
Nothing used it but the unit tests; everything else knows to use
compare_tor_addr_to_addr_policy instead.
Diffstat (limited to 'src')
-rw-r--r-- | src/or/policies.c | 12 | ||||
-rw-r--r-- | src/or/policies.h | 2 | ||||
-rw-r--r-- | src/test/test.c | 9 |
3 files changed, 6 insertions, 17 deletions
diff --git a/src/or/policies.c b/src/or/policies.c index f80808dd62..5bd13b5014 100644 --- a/src/or/policies.c +++ b/src/or/policies.c @@ -570,18 +570,6 @@ addr_policy_get_canonical_entry(addr_policy_t *e) return found->policy; } -/** As compare_tor_addr_to_addr_policy, but instead of a tor_addr_t, takes - * in host order. */ -addr_policy_result_t -compare_addr_to_addr_policy(uint32_t addr, uint16_t port, - const smartlist_t *policy) -{ - /*XXXX deprecate this function when possible. */ - tor_addr_t a; - tor_addr_from_ipv4h(&a, addr); - return compare_tor_addr_to_addr_policy(&a, port, policy); -} - /** Helper for compare_tor_addr_to_addr_policy. Implements the case where * addr and port are both known. */ static addr_policy_result_t diff --git a/src/or/policies.h b/src/or/policies.h index 6f3624aba1..9859b008cf 100644 --- a/src/or/policies.h +++ b/src/or/policies.h @@ -37,8 +37,6 @@ addr_policy_t *addr_policy_get_canonical_entry(addr_policy_t *ent); int cmp_addr_policies(smartlist_t *a, smartlist_t *b); addr_policy_result_t compare_tor_addr_to_addr_policy(const tor_addr_t *addr, uint16_t port, const smartlist_t *policy); -addr_policy_result_t compare_addr_to_addr_policy(uint32_t addr, - uint16_t port, const smartlist_t *policy); addr_policy_result_t compare_addr_to_node_policy(uint32_t addr, uint16_t port, const node_t *node); diff --git a/src/test/test.c b/src/test/test.c index 74ada0ea81..05f5922a5b 100644 --- a/src/test/test.c +++ b/src/test/test.c @@ -998,12 +998,15 @@ test_policies(void) smartlist_add(policy, p); + tor_addr_from_ipv4h(&tar, 0x01020304u); test_assert(ADDR_POLICY_ACCEPTED == - compare_addr_to_addr_policy(0x01020304u, 2, policy)); + compare_tor_addr_to_addr_policy(&tar, 2, policy)); + tor_addr_make_unspec(&tar); test_assert(ADDR_POLICY_PROBABLY_ACCEPTED == - compare_addr_to_addr_policy(0, 2, policy)); + compare_tor_addr_to_addr_policy(&tar, 2, policy)); + tor_addr_from_ipv4h(&tar, 0xc0a80102); test_assert(ADDR_POLICY_REJECTED == - compare_addr_to_addr_policy(0xc0a80102, 2, policy)); + compare_tor_addr_to_addr_policy(&tar, 2, policy)); test_assert(0 == policies_parse_exit_policy(NULL, &policy2, 1, NULL, 1)); test_assert(policy2); |