tor  0.4.2.1-alpha-dev
dirlist.h
Go to the documentation of this file.
1 /* Copyright (c) 2001-2004, Roger Dingledine.
2  * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
3  * Copyright (c) 2007-2019, The Tor Project, Inc. */
4 /* See LICENSE for licensing information */
5 
11 #ifndef TOR_DIRLIST_H
12 #define TOR_DIRLIST_H
13 
15 const smartlist_t *router_get_trusted_dir_servers(void);
16 const smartlist_t *router_get_fallback_dir_servers(void);
18 smartlist_t *router_get_fallback_dir_servers_mutable(void);
19 void mark_all_dirservers_up(smartlist_t *server_list);
20 
23  const char *digest);
24 int router_digest_is_fallback_dir(const char *digest);
25 MOCK_DECL(dir_server_t *, trusteddirserver_get_by_v3_auth_digest,
26  (const char *d));
27 
28 int router_digest_is_trusted_dir_type(const char *digest,
29  dirinfo_type_t type);
30 #define router_digest_is_trusted_dir(d) \
31  router_digest_is_trusted_dir_type((d), NO_DIRINFO)
32 
33 dir_server_t *trusted_dir_server_new(const char *nickname, const char *address,
34  uint16_t dir_port, uint16_t or_port,
35  const tor_addr_port_t *addrport_ipv6,
36  const char *digest, const char *v3_auth_digest,
37  dirinfo_type_t type, double weight);
39  uint16_t dir_port, uint16_t or_port,
40  const tor_addr_port_t *addrport_ipv6,
41  const char *id_digest, double weight);
42 void dir_server_add(dir_server_t *ent);
43 
44 void clear_dir_servers(void);
45 void dirlist_free_all(void);
46 
47 #endif /* !defined(TOR_DIRLIST_H) */
int router_digest_is_fallback_dir(const char *digest)
Definition: dirlist.c:157
dir_server_t * router_get_fallback_dirserver_by_digest(const char *digest)
Definition: dirlist.c:133
int router_digest_is_trusted_dir_type(const char *digest, dirinfo_type_t type)
Definition: dirlist.c:208
dir_server_t * router_get_trusteddirserver_by_digest(const char *d)
Definition: dirlist.c:112
void mark_all_dirservers_up(smartlist_t *server_list)
Definition: dirlist.c:184
dirinfo_type_t
Definition: or.h:891
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)
Definition: dirlist.c:353
int get_n_authorities(dirinfo_type_t type)
Definition: dirlist.c:55
void dir_server_add(dir_server_t *ent)
Definition: dirlist.c:366
void clear_dir_servers(void)
Definition: dirlist.c:398
#define MOCK_DECL(rv, funcname, arglist)
Definition: testsupport.h:94
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)
Definition: dirlist.c:308
smartlist_t * router_get_trusted_dir_servers_mutable(void)
Definition: dirlist.c:71