From 46a62e3256e078866c68e119d1da2afdb10a8306 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Mon, 10 Sep 2012 16:33:19 -0400 Subject: Refactor add_trusted_dir_server Now creating a dir_server_t and adding it are separate functions, and there are frontend functions for adding a trusted dirserver and a fallback dirserver. --- src/or/routerlist.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/or/routerlist.h') diff --git a/src/or/routerlist.h b/src/or/routerlist.h index 95867552c2..1d527d0220 100644 --- a/src/or/routerlist.h +++ b/src/or/routerlist.h @@ -132,11 +132,16 @@ void router_load_extrainfo_from_string(const char *s, const char *eos, void routerlist_retry_directory_downloads(time_t now); int router_exit_policy_rejects_all(const routerinfo_t *router); -dir_server_t *add_trusted_dir_server(const char *nickname, - const char *address, - uint16_t dir_port, uint16_t or_port, - const char *digest, const char *v3_auth_digest, - dirinfo_type_t type); + +dir_server_t *trusted_dir_server_new(const char *nickname, const char *address, + uint16_t dir_port, uint16_t or_port, + const char *digest, const char *v3_auth_digest, + dirinfo_type_t type); +dir_server_t *fallback_dir_server_new(const tor_addr_t *addr, + uint16_t dir_port, uint16_t or_port, + const char *id_digest); +void dir_server_add(dir_server_t *ent); + void authority_cert_free(authority_cert_t *cert); void clear_dir_servers(void); int any_trusted_dir_is_v1_authority(void); -- cgit v1.2.3-54-g00ecf