diff options
author | Nick Mathewson <nickm@torproject.org> | 2004-12-04 01:14:36 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2004-12-04 01:14:36 +0000 |
commit | fc87758ff3a1e194df96fb6914680d451cf8fe47 (patch) | |
tree | 9562b7b31a3d89300d53c3788d49fd3f4cf2349d /src/or/or.h | |
parent | e6942686444f0e25c903213add09ae95530f2805 (diff) | |
download | tor-fc87758ff3a1e194df96fb6914680d451cf8fe47.tar.gz tor-fc87758ff3a1e194df96fb6914680d451cf8fe47.zip |
Add function to check that addr_policy_t is okay; change struct addr_policy_t to addr_policy_t.
svn:r3070
Diffstat (limited to 'src/or/or.h')
-rw-r--r-- | src/or/or.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/or/or.h b/src/or/or.h index e90d158eaa..7bb6bc948d 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -582,7 +582,7 @@ typedef struct connection_t connection_t; #define ADDR_POLICY_REJECT 2 /** A linked list of policy rules */ -struct addr_policy_t { +typedef struct addr_policy_t { char policy_type; /**< One of ADDR_POLICY_ACCEPT or ADDR_POLICY_REJECT. */ char *string; /**< String representation of this rule. */ uint32_t addr; /**< Base address to accept or reject. */ @@ -592,7 +592,7 @@ struct addr_policy_t { uint16_t prt_max; /**< Highest port number to accept/reject. */ struct addr_policy_t *next; /**< Next rule in list. */ -}; +} addr_policy_t; /** Information about another onion router in the network. */ typedef struct { @@ -619,7 +619,7 @@ typedef struct { uint32_t bandwidthburst; /**< How large is this OR's token bucket? */ /** How many bytes/s is this router known to handle? */ uint32_t bandwidthcapacity; - struct addr_policy_t *exit_policy; /**< What streams will this OR permit + addr_policy_t *exit_policy; /**< What streams will this OR permit * to exit? */ long uptime; /**< How many seconds the router claims to have been up */ /* local info */ @@ -1124,8 +1124,8 @@ void options_init(or_options_t *options); int init_from_config(int argc, char **argv); int config_init_logs(or_options_t *options, int validate_only); int config_parse_addr_policy(struct config_line_t *cfg, - struct addr_policy_t **dest); -void addr_policy_free(struct addr_policy_t *p); + addr_policy_t **dest); +void addr_policy_free(addr_policy_t *p); int config_option_is_recognized(const char *key); struct config_line_t *config_get_assigned_option(or_options_t *options, const char *key); @@ -1595,7 +1595,7 @@ void routerlist_remove_old_routers(int age); int router_load_routerlist_from_directory(const char *s,crypto_pk_env_t *pkey, int check_version); int router_compare_addr_to_addr_policy(uint32_t addr, uint16_t port, - struct addr_policy_t *policy); + addr_policy_t *policy); #define ADDR_POLICY_ACCEPTED 0 #define ADDR_POLICY_REJECTED -1 #define ADDR_POLICY_UNKNOWN 1 @@ -1682,12 +1682,13 @@ int router_parse_routerlist_from_directory(const char *s, running_routers_t *router_parse_runningrouters(const char *str); routerinfo_t *router_parse_entry_from_string(const char *s, const char *end); int router_add_exit_policy_from_string(routerinfo_t *router, const char *s); -struct addr_policy_t *router_parse_addr_policy_from_string(const char *s); +addr_policy_t *router_parse_addr_policy_from_string(const char *s); int check_software_version_against_directory(const char *directory, int ignoreversion); int tor_version_parse(const char *s, tor_version_t *out); int tor_version_as_new_as(const char *platform, const char *cutoff); int tor_version_compare(tor_version_t *a, tor_version_t *b); +void assert_addr_policy_ok(addr_policy_t *t); #endif |