Macros | Functions
extendinfo.h File Reference

Header for core/or/extendinfo.c. More...

Go to the source code of this file.


#define extend_info_free(info)    FREE_AND_NULL(extend_info_t, extend_info_free_, (info))


extend_info_textend_info_new (const char *nickname, const char *rsa_id_digest, const struct ed25519_public_key_t *ed_id, crypto_pk_t *onion_key, const struct curve25519_public_key_t *ntor_key, const tor_addr_t *addr, uint16_t port, const struct protover_summary_flags_t *pv, bool for_exit_use)
extend_info_textend_info_from_node (const node_t *r, int for_direct_connect, bool for_exit)
extend_info_textend_info_dup (extend_info_t *info)
void extend_info_free_ (extend_info_t *info)
int extend_info_addr_is_allowed (const tor_addr_t *addr)
int extend_info_supports_tap (const extend_info_t *ei)
int extend_info_supports_ntor (const extend_info_t *ei)
int extend_info_supports_ntor_v3 (const extend_info_t *ei)
int extend_info_has_preferred_onion_key (const extend_info_t *ei)
bool extend_info_has_orport (const extend_info_t *ei, const tor_addr_t *addr, uint16_t port)
int extend_info_add_orport (extend_info_t *ei, const tor_addr_t *addr, uint16_t port)
const tor_addr_port_textend_info_get_orport (const extend_info_t *ei, int family)
const tor_addr_port_textend_info_pick_orport (const extend_info_t *ei)
bool extend_info_any_orport_addr_is_internal (const extend_info_t *ei)

Detailed Description

Header for core/or/extendinfo.c.

Definition in file extendinfo.h.

Macro Definition Documentation

◆ extend_info_free

#define extend_info_free (   info)     FREE_AND_NULL(extend_info_t, extend_info_free_, (info))

Definition at line 27 of file extendinfo.h.

Function Documentation

◆ extend_info_add_orport()

int extend_info_add_orport ( extend_info_t ei,
const tor_addr_t addr,
uint16_t  port 

Add another address:port pair to a given extend_info_t, if there is room. Return 0 on success, -1 on failure.

Definition at line 75 of file extendinfo.c.

◆ extend_info_addr_is_allowed()

int extend_info_addr_is_allowed ( const tor_addr_t addr)

Return true iff the given address can be used to extend to.

Definition at line 246 of file extendinfo.c.

◆ extend_info_any_orport_addr_is_internal()

bool extend_info_any_orport_addr_is_internal ( const extend_info_t ei)

Return true if any orport address in ei is an internal address.

Definition at line 340 of file extendinfo.c.

Referenced by circuit_handle_first_hop().

◆ extend_info_dup()

extend_info_t * extend_info_dup ( extend_info_t info)

Allocate and return a new extend_info_t with the same contents as info.

Definition at line 193 of file extendinfo.c.

◆ extend_info_free_()

void extend_info_free_ ( extend_info_t info)

Release storage held by an extend_info_t struct.

Definition at line 182 of file extendinfo.c.

◆ extend_info_from_node()

extend_info_t * extend_info_from_node ( const node_t node,
int  for_direct_connect,
bool  for_exit 

Allocate and return a new extend_info that can be used to build a circuit to or through the node node. Use the primary address of the node (i.e. its IPv4 address) unless for_direct_connect is true, in which case the preferred address is used instead. May return NULL if there is not enough info about node to extend to it–for example, if the preferred routerinfo_t or microdesc_t is missing, or if for_direct_connect is true and none of the node's addresses is allowed by tor's firewall and IP version config.

Definition at line 100 of file extendinfo.c.

Referenced by get_extend_info_from_intro_point().

◆ extend_info_get_orport()

const tor_addr_port_t * extend_info_get_orport ( const extend_info_t ei,
int  family 

If the extend_info ei has an orport of the chosen family, then return that orport. Otherwise, return NULL.

Definition at line 285 of file extendinfo.c.

Referenced by extend_info_describe(), and router_do_orport_reachability_checks().

◆ extend_info_has_orport()

bool extend_info_has_orport ( const extend_info_t ei,
const tor_addr_t addr,
uint16_t  port 

Return true if addr : port is a listed ORPort in ei.

Definition at line 265 of file extendinfo.c.

Referenced by connection_ap_fail_onehop().

◆ extend_info_has_preferred_onion_key()

int extend_info_has_preferred_onion_key ( const extend_info_t ei)

Definition at line 238 of file extendinfo.c.

◆ extend_info_pick_orport()

const tor_addr_port_t * extend_info_pick_orport ( const extend_info_t ei)

Chose an addr_port_t within ei to connect to.

Definition at line 300 of file extendinfo.c.

Referenced by channel_connect_for_circuit().

◆ extend_info_supports_ntor()

int extend_info_supports_ntor ( const extend_info_t ei)

Definition at line 217 of file extendinfo.c.

◆ extend_info_supports_ntor_v3()

int extend_info_supports_ntor_v3 ( const extend_info_t ei)

Return true if we can use the Ntor v3 handshake with ei

Definition at line 228 of file extendinfo.c.

◆ extend_info_supports_tap()

int extend_info_supports_tap ( const extend_info_t ei)

Definition at line 208 of file extendinfo.c.