diff options
author | Nick Mathewson <nickm@torproject.org> | 2004-05-10 17:30:51 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2004-05-10 17:30:51 +0000 |
commit | b45fafa3d0a860cba95ce81eb7d1677a0875f019 (patch) | |
tree | 4d6b0715a9c78b649dab869b35cd322f41ae0548 /src/or/or.h | |
parent | cfcb032a1e9ff77d49c0b6c415418e936667d565 (diff) | |
download | tor-b45fafa3d0a860cba95ce81eb7d1677a0875f019.tar.gz tor-b45fafa3d0a860cba95ce81eb7d1677a0875f019.zip |
Split directory/router parsing functionality into separate file from routerlist.c
svn:r1846
Diffstat (limited to 'src/or/or.h')
-rw-r--r-- | src/or/or.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/or/or.h b/src/or/or.h index 42ec606ca8..aac00b5bbd 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -1185,16 +1185,13 @@ routerinfo_t *router_choose_random_node(routerlist_t *dir, routerinfo_t *router_get_by_addr_port(uint32_t addr, uint16_t port); routerinfo_t *router_get_by_nickname(char *nickname); void router_get_routerlist(routerlist_t **prouterlist); +void routerlist_free(routerlist_t *routerlist); void routerinfo_free(routerinfo_t *router); routerinfo_t *routerinfo_copy(const routerinfo_t *router); void router_mark_as_down(char *nickname); int router_set_routerlist_from_file(char *routerfile); int router_set_routerlist_from_string(const char *s); -int router_get_dir_hash(const char *s, char *digest); -int router_get_router_hash(const char *s, char *digest); int router_set_routerlist_from_directory(const char *s, crypto_pk_env_t *pkey); -routerinfo_t *router_get_entry_from_string(const char *s, const char *end); -int router_add_exit_policy_from_string(routerinfo_t *router, const char *s); int router_compare_addr_to_exit_policy(uint32_t addr, uint16_t port, struct exit_policy_t *policy); #define ADDR_POLICY_ACCEPTED 0 @@ -1203,6 +1200,20 @@ int router_compare_addr_to_exit_policy(uint32_t addr, uint16_t port, int router_exit_policy_all_routers_reject(uint32_t addr, uint16_t port); int router_exit_policy_rejects_all(routerinfo_t *router); +/********************************* routerparse.c ************************/ + +int router_get_router_hash(const char *s, char *digest); +int router_get_dir_hash(const char *s, char *digest); +int router_parse_list_from_string(const char **s, + routerlist_t **dest, + int n_good_nicknames, + const char **good_nickname_lst); +int router_parse_routerlist_from_directory(const char *s, + routerlist_t **dest, + crypto_pk_env_t *pkey); +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); + /********************************* dirserv.c ***************************/ int dirserv_add_own_fingerprint(const char *nickname, crypto_pk_env_t *pk); int dirserv_parse_fingerprint_file(const char *fname); |