Tor  0.4.5.0-alpha-dev
Functions
relay_find_addr.h File Reference

Header file for relay_find_addr.c. More...

Go to the source code of this file.

Functions

int router_pick_published_address (const or_options_t *options, uint32_t *addr, int cache_only)
 
void router_new_address_suggestion (const char *suggestion, const dir_connection_t *d_conn)
 

Detailed Description

Header file for relay_find_addr.c.

Definition in file relay_find_addr.h.

Function Documentation

◆ router_new_address_suggestion()

void router_new_address_suggestion ( const char *  suggestion,
const dir_connection_t d_conn 
)

A directory server d_conn told us our IP address is suggestion. If this address is different from the one we think we are now, and if our computer doesn't actually know its IP address, then switch.

Definition at line 45 of file relay_find_addr.c.

◆ router_pick_published_address()

int router_pick_published_address ( const or_options_t options,
uint32_t *  addr,
int  cache_only 
)

Make a current best guess at our address, either because it's configured in torrc, or because we've learned it from dirserver headers. Place the answer in *addr and return 0 on success, else return -1 if we have no guess.

If cache_only is true, just return any cached answers, and don't try to get any new answers.

Definition at line 119 of file relay_find_addr.c.

Referenced by dirclient_fetches_from_authorities(), pt_get_extra_info_descriptor_string(), and router_rebuild_descriptor().