diff options
author | rl1987 <rl1987@sdf.lonestar.org> | 2014-09-13 16:25:48 +0300 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-09-22 14:18:00 -0400 |
commit | c735b60e4ce2d2806d8cc285d7b9b2795f9732b4 (patch) | |
tree | 7af91e5610ba51a0cdbf0eb64cef0772d7389c12 /src/or/policies.h | |
parent | f8f0cb0443c0709454c9223f25266ec1b0c464b8 (diff) | |
download | tor-c735b60e4ce2d2806d8cc285d7b9b2795f9732b4.tar.gz tor-c735b60e4ce2d2806d8cc285d7b9b2795f9732b4.zip |
New API for policies_parse_exit_policy().
Diffstat (limited to 'src/or/policies.h')
-rw-r--r-- | src/or/policies.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/or/policies.h b/src/or/policies.h index da1feaf02d..0b47b761ec 100644 --- a/src/or/policies.h +++ b/src/or/policies.h @@ -18,6 +18,12 @@ */ #define POLICY_BUF_LEN 72 +#define EXIT_POLICY_IPV6_ENABLED (1 << 0) +#define EXIT_POLICY_REJECT_PRIVATE (1 << 1) +#define EXIT_POLICY_ADD_DEFAULT (1 << 2) + +typedef int exit_policy_parser_cfg_t; + int firewall_is_fascist_or(void); int fascist_firewall_allows_address_or(const tor_addr_t *addr, uint16_t port); int fascist_firewall_allows_or(const routerinfo_t *ri); @@ -42,10 +48,18 @@ MOCK_DECL(addr_policy_result_t, compare_tor_addr_to_addr_policy, addr_policy_result_t compare_tor_addr_to_node_policy(const tor_addr_t *addr, uint16_t port, const node_t *node); +/* int policies_parse_exit_policy(config_line_t *cfg, smartlist_t **dest, int ipv6exit, int rejectprivate, uint32_t local_address, int add_default_policy); +*/ +int policies_parse_exit_policy_from_options(const or_options_t *or_options, + uint32_t local_address, + smartlist_t **result); +int policies_parse_exit_policy(config_line_t *cfg, smartlist_t **dest, + exit_policy_parser_cfg_t options, + uint32_t local_address); void policies_exit_policy_append_reject_star(smartlist_t **dest); void addr_policy_append_reject_addr(smartlist_t **dest, const tor_addr_t *addr); |