34 const char *rsa_id_digest,
104 if (for_direct_connect)
109 valid_addr = tor_addr_port_is_valid_ap(&ap, 0);
112 log_debug(
LD_CIRC,
"using %s for %s",
116 log_warn(
LD_CIRC,
"Could not choose valid address for %s",
122 "Attempted to create extend_info for a node that does not support "
135 log_info(
LD_CIRC,
"Not including the ed25519 ID for %s, since it won't "
136 "be able to authenticate it.",
143 rsa_pubkey = node_get_rsa_onion_key(node);
145 if (valid_addr && node->ri) {
153 }
else if (valid_addr && node->rs && node->md) {
163 crypto_pk_free(rsa_pubkey);
219 return extend_info_supports_ntor(ei);
252 if (
tor_addr_eq(&ei_ap->addr, addr) && ei_ap->port == port)
298 if (family == AF_INET || (ipv6_ok && family == AF_INET6)) {
299 usable[n_usable++] = a;
326 tor_addr_is_internal(&ei->
orports[i].addr, 0))
void tor_addr_copy(tor_addr_t *dest, const tor_addr_t *src)
const char * fmt_addrport(const tor_addr_t *addr, uint16_t port)
void tor_addr_make_unspec(tor_addr_t *a)
int tor_addr_is_multicast(const tor_addr_t *a)
static sa_family_t tor_addr_family(const tor_addr_t *a)
#define tor_addr_eq(a, b)
static bool tor_addr_is_unspec(const tor_addr_t *a)
const or_options_t * get_options(void)
Header file for config.c.
int ed25519_public_key_is_zero(const ed25519_public_key_t *pubkey)
Common functions for using (pseudo-)random number generators.
crypto_fast_rng_t * get_thread_fast_rng(void)
unsigned crypto_fast_rng_get_uint(crypto_fast_rng_t *rng, unsigned limit)
crypto_pk_t * crypto_pk_dup_key(crypto_pk_t *orig)
const char * node_describe(const node_t *node)
Header file for describe.c.
#define EXTEND_INFO_MAX_ADDRS
void extend_info_free_(extend_info_t *info)
const tor_addr_port_t * extend_info_get_orport(const extend_info_t *ei, int family)
int extend_info_add_orport(extend_info_t *ei, const tor_addr_t *addr, uint16_t port)
extend_info_t * extend_info_from_node(const node_t *node, int for_direct_connect)
extend_info_t * extend_info_new(const char *nickname, const char *rsa_id_digest, const ed25519_public_key_t *ed_id, crypto_pk_t *onion_key, const curve25519_public_key_t *ntor_key, const tor_addr_t *addr, uint16_t port)
const tor_addr_port_t * extend_info_pick_orport(const extend_info_t *ei)
bool extend_info_any_orport_addr_is_internal(const extend_info_t *ei)
extend_info_t * extend_info_dup(extend_info_t *info)
bool extend_info_has_orport(const extend_info_t *ei, const tor_addr_t *addr, uint16_t port)
int extend_info_addr_is_allowed(const tor_addr_t *addr)
Header for core/or/extendinfo.c.
#define log_fn(severity, domain, args,...)
Node information structure.
void node_get_prim_orport(const node_t *node, tor_addr_port_t *ap_out)
int node_has_preferred_descriptor(const node_t *node, int for_direct_connect)
bool node_supports_ed25519_link_authentication(const node_t *node, bool compatible_with_us)
const ed25519_public_key_t * node_get_ed25519_id(const node_t *node)
const curve25519_public_key_t * node_get_curve25519_onion_key(const node_t *node)
int node_has_curve25519_onion_key(const node_t *node)
Header file for nodelist.c.
Master header file for Tor-specific functionality.
void reachable_addr_choose_from_node(const node_t *node, firewall_connection_t fw_connection, int pref_only, tor_addr_port_t *ap)
Header file for policies.c.
bool router_can_extend_over_ipv6(const or_options_t *options)
Header file for router.c.
Router descriptor structure.
int server_mode(const or_options_t *options)
Header file for routermode.c.
Routerstatus (consensus entry) structure.
tor_addr_port_t orports[EXTEND_INFO_MAX_ADDRS]
ed25519_public_key_t ed_identity
char identity_digest[DIGEST_LEN]
char nickname[MAX_HEX_NICKNAME_LEN+1]
curve25519_public_key_t curve25519_onion_key
char identity[DIGEST_LEN]
char nickname[MAX_NICKNAME_LEN+1]
#define IF_BUG_ONCE(cond)
int fast_mem_is_zero(const char *mem, size_t len)
#define CURVE25519_PUBKEY_LEN