Tor  0.4.5.0-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-2020, The Tor Project, Inc. */
4 /* See LICENSE for licensing information */
5 
6 /**
7  * \file dirlist.h
8  * \brief Header file for dirlist.c
9  **/
10 
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);
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 
48 
49 #endif /* !defined(TOR_DIRLIST_H) */
tor_addr_t
Definition: address.h:68
router_get_fallback_dirserver_by_digest
dir_server_t * router_get_fallback_dirserver_by_digest(const char *digest)
Definition: dirlist.c:165
router_get_trusted_dir_servers_mutable
smartlist_t * router_get_trusted_dir_servers_mutable(void)
Definition: dirlist.c:103
fallback_dir_server_new
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:388
routerstatus_t::nickname
char nickname[MAX_NICKNAME_LEN+1]
Definition: routerstatus_st.h:25
router_digest_is_trusted_dir_type
int router_digest_is_trusted_dir_type(const char *digest, dirinfo_type_t type)
Definition: dirlist.c:240
router_get_trusteddirserver_by_digest
dir_server_t * router_get_trusteddirserver_by_digest(const char *d)
Definition: dirlist.c:144
mark_all_dirservers_up
void mark_all_dirservers_up(smartlist_t *server_list)
Definition: dirlist.c:216
tor_addr_port_t
Definition: address.h:80
routerstatus_t::addr
uint32_t addr
Definition: routerstatus_st.h:32
routerstatus_t::or_port
uint16_t or_port
Definition: routerstatus_st.h:33
clear_dir_servers
void clear_dir_servers(void)
Definition: dirlist.c:433
MOCK_DECL
#define MOCK_DECL(rv, funcname, arglist)
Definition: testsupport.h:127
dir_server_t
Definition: dir_server_st.h:21
dir_server_add
void dir_server_add(dir_server_t *ent)
Definition: dirlist.c:401
get_n_authorities
int get_n_authorities(dirinfo_type_t type)
Definition: dirlist.c:87
dirinfo_type_t
dirinfo_type_t
Definition: or.h:905
routerstatus_t::dir_port
uint16_t dir_port
Definition: routerstatus_st.h:34
trusted_dir_server_new
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:340
trusteddirserver_get_by_v3_auth_digest
dir_server_t * trusteddirserver_get_by_v3_auth_digest(const char *d)
Definition: dirlist.c:199
dirlist_add_trusted_dir_addresses
void dirlist_add_trusted_dir_addresses(void)
Definition: dirlist.c:71
smartlist_t
Definition: smartlist_core.h:26
router_digest_is_fallback_dir
int router_digest_is_fallback_dir(const char *digest)
Definition: dirlist.c:189