diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-09-19 14:10:15 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-09-19 17:08:57 -0400 |
commit | 08e3b88f0774fedb41a6b1c170a710dd12a7cb90 (patch) | |
tree | 856a7f9ce528021c1d0c9d09b631d09aeec2356c /src/feature/nodelist/dirlist.h | |
parent | 119159677be14351ebcae647d3988f4f2fd9eb72 (diff) | |
download | tor-08e3b88f0774fedb41a6b1c170a710dd12a7cb90.tar.gz tor-08e3b88f0774fedb41a6b1c170a710dd12a7cb90.zip |
Split routerlist.c into 4 separate modules
There are now separate modules for:
* the list of router descriptors
* the list of authorities and fallbacks
* managing authority certificates
* selecting random nodes
Diffstat (limited to 'src/feature/nodelist/dirlist.h')
-rw-r--r-- | src/feature/nodelist/dirlist.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/feature/nodelist/dirlist.h b/src/feature/nodelist/dirlist.h new file mode 100644 index 0000000000..6baa5686c5 --- /dev/null +++ b/src/feature/nodelist/dirlist.h @@ -0,0 +1,47 @@ +/* Copyright (c) 2001-2004, Roger Dingledine. + * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson. + * Copyright (c) 2007-2018, The Tor Project, Inc. */ +/* See LICENSE for licensing information */ + +/** + * \file dirlist.h + * \brief Header file for dirlist.c + **/ + +#ifndef TOR_DIRLIST_H +#define TOR_DIRLIST_H + +int get_n_authorities(dirinfo_type_t type); +const smartlist_t *router_get_trusted_dir_servers(void); +const smartlist_t *router_get_fallback_dir_servers(void); +smartlist_t *router_get_trusted_dir_servers_mutable(void); +smartlist_t *router_get_fallback_dir_servers_mutable(void); +void mark_all_dirservers_up(smartlist_t *server_list); + +dir_server_t *router_get_trusteddirserver_by_digest(const char *d); +dir_server_t *router_get_fallback_dirserver_by_digest( + const char *digest); +int router_digest_is_fallback_dir(const char *digest); +MOCK_DECL(dir_server_t *, trusteddirserver_get_by_v3_auth_digest, + (const char *d)); + +int router_digest_is_trusted_dir_type(const char *digest, + dirinfo_type_t type); +#define router_digest_is_trusted_dir(d) \ + router_digest_is_trusted_dir_type((d), NO_DIRINFO) + +dir_server_t *trusted_dir_server_new(const char *nickname, const char *address, + uint16_t dir_port, uint16_t or_port, + const tor_addr_port_t *addrport_ipv6, + const char *digest, const char *v3_auth_digest, + dirinfo_type_t type, double weight); +dir_server_t *fallback_dir_server_new(const tor_addr_t *addr, + uint16_t dir_port, uint16_t or_port, + const tor_addr_port_t *addrport_ipv6, + const char *id_digest, double weight); +void dir_server_add(dir_server_t *ent); + +void clear_dir_servers(void); +void dirlist_free_all(void); + +#endif |