Tor  0.4.6.0-alpha-dev
Macros | Functions
extendinfo.h File Reference

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

Go to the source code of this file.

Macros

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

Functions

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)
 
extend_info_textend_info_from_node (const node_t *r, int for_direct_connect)
 
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_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.

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 67 of file extendinfo.c.

Referenced by rend_service_parse_intro_for_v2().

◆ 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 224 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 318 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 180 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 169 of file extendinfo.c.

◆ extend_info_from_node()

extend_info_t* extend_info_from_node ( const node_t node,
int  for_direct_connect 
)

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 92 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 263 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 243 of file extendinfo.c.

Referenced by connection_ap_fail_onehop().

◆ 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 278 of file extendinfo.c.

Referenced by channel_connect_for_circuit().