diff options
author | Peter Palfrader <peter@palfrader.org> | 2008-08-13 12:45:28 +0000 |
---|---|---|
committer | Peter Palfrader <peter@palfrader.org> | 2008-08-13 12:45:28 +0000 |
commit | b2344a9e4dd5cbd23bc1138d5ba77c4f230fa416 (patch) | |
tree | 53d039ae50c4f9f35e63e9171afccc679dab6d6c /src/or/policies.c | |
parent | 49a616e0fadb9a7c8cf041693f431f221297cf9c (diff) | |
download | tor-b2344a9e4dd5cbd23bc1138d5ba77c4f230fa416.tar.gz tor-b2344a9e4dd5cbd23bc1138d5ba77c4f230fa416.zip |
Move policy_summarize() prototype to or.h
svn:r16522
Diffstat (limited to 'src/or/policies.c')
-rw-r--r-- | src/or/policies.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/src/or/policies.c b/src/or/policies.c index a51d01b74f..cfd6e4bbdc 100644 --- a/src/or/policies.c +++ b/src/or/policies.c @@ -38,6 +38,22 @@ static smartlist_t *reachable_or_addr_policy = NULL; * to directories at. */ static smartlist_t *reachable_dir_addr_policy = NULL; +/** Element of an exit policy summary */ +typedef struct policy_summary_item_t { + uint16_t prt_min; /**< Lowest port number to accept/reject. */ + uint16_t prt_max; /**< Highest port number to accept/reject. */ + uint64_t reject_count; /**< Number of IP-Addresses that are rejected to + this portrange. */ + int accepted:1; /** Has this port already been accepted */ +} policy_summary_item_t; + +smartlist_t *policy_summary_create(void); +void policy_summary_accept(smartlist_t *summary, uint16_t prt_min, uint16_t prt_max); +void policy_summary_reject(smartlist_t *summary, maskbits_t maskbits, uint16_t prt_min, uint16_t prt_max); +void policy_summary_add_item(smartlist_t *summary, addr_policy_t *p); +int policy_summary_split(smartlist_t *summary, uint16_t prt_min, uint16_t prt_max); +policy_summary_item_t* policy_summary_item_split(policy_summary_item_t* old, uint16_t new_starts); + /** Private networks. This list is used in two places, once to expand the * "private" keyword when parsing our own exit policy, secondly to ignore * just such networks when building exit policy summaries. It is important @@ -911,23 +927,6 @@ policy_write_item(char *buf, size_t buflen, addr_policy_t *policy, return (int)written; } -/** Element of an exit policy summary */ -typedef struct policy_summary_item_t { - uint16_t prt_min; /**< Lowest port number to accept/reject. */ - uint16_t prt_max; /**< Highest port number to accept/reject. */ - uint64_t reject_count; /**< Number of IP-Addresses that are rejected to - this portrange. */ - int accepted:1; /** Has this port already been accepted */ -} policy_summary_item_t; - -smartlist_t *policy_summary_create(void); -void policy_summary_accept(smartlist_t *summary, uint16_t prt_min, uint16_t prt_max); -void policy_summary_reject(smartlist_t *summary, maskbits_t maskbits, uint16_t prt_min, uint16_t prt_max); -void policy_summary_add_item(smartlist_t *summary, addr_policy_t *p); -char * policy_summarize(smartlist_t *policy); -int policy_summary_split(smartlist_t *summary, uint16_t prt_min, uint16_t prt_max); -policy_summary_item_t* policy_summary_item_split(policy_summary_item_t* old, uint16_t new_starts); - /** Create a new exit policy summary, initially only with a single * port 1-64k item */ /* XXXX This entire thing will do most stuff in O(N^2), or worse. Use an @@ -1169,7 +1168,6 @@ policy_summarize(smartlist_t *policy) return result; } - /** Implementation for GETINFO control command: knows the answer for questions * about "exit-policy/..." */ int |