11 #ifndef TOR_NODE_SELECT_H
12 #define TOR_NODE_SELECT_H
18 CRN_NEED_UPTIME = 1<<0,
20 CRN_NEED_CAPACITY = 1<<1,
25 CRN_NEED_GUARD = 1<<3,
28 CRN_DIRECT_CONN = 1<<4,
34 CRN_RENDEZVOUS_V3 = 1<<6,
36 CRN_INITIATE_IPV6_EXTEND = 1<<7,
42 NO_WEIGHTING, WEIGHT_FOR_EXIT, WEIGHT_FOR_MID, WEIGHT_FOR_GUARD,
50 #define PDS_ALLOW_SELF (1<<0)
54 #define PDS_RETRY_IF_NO_SERVERS (1<<1)
60 #define PDS_IGNORE_FASCISTFIREWALL (1<<2)
67 #define PDS_NO_EXISTING_SERVERDESC_FETCH (1<<3)
73 #define PDS_NO_EXISTING_MICRODESC_FETCH (1<<4)
78 int router_get_my_share_of_directory_requests(
double *v3_share_out);
86 struct routerset_t *excludedset,
94 #ifdef NODE_SELECT_PRIVATE
98 const double *entries_in,
100 uint64_t *total_out);
105 int serverdesc,
int microdesc);
STATIC int choose_array_element_by_weight(const uint64_t *entries, int n_entries)
STATIC void scale_array_elements_to_u64(uint64_t *entries_out, const double *entries_in, int n_entries, uint64_t *total_out)
STATIC const routerstatus_t * router_pick_directory_server_impl(dirinfo_type_t type, int flags, int *n_busy_out)
const node_t * router_choose_random_node(smartlist_t *excludedsmartlist, struct routerset_t *excludedset, router_crn_flags_t flags)
const routerstatus_t * router_pick_fallback_dirserver(dirinfo_type_t type, int flags)
double frac_nodes_with_descriptors(const smartlist_t *sl, bandwidth_weight_rule_t rule, int for_direct_conn)
const node_t * node_sl_choose_by_bandwidth(const smartlist_t *sl, bandwidth_weight_rule_t rule)
const routerstatus_t * router_pick_directory_server(dirinfo_type_t type, int flags)
const routerstatus_t * router_pick_trusteddirserver(dirinfo_type_t type, int flags)