tor  0.4.0.1-alpha
Functions
routerinfo.h File Reference

Go to the source code of this file.

Functions

void router_get_prim_orport (const routerinfo_t *router, tor_addr_port_t *addr_port_out)
 
int router_has_orport (const routerinfo_t *router, const tor_addr_port_t *orport)
 
void router_get_verbose_nickname (char *buf, const routerinfo_t *router)
 
smartlist_trouter_get_all_orports (const routerinfo_t *ri)
 
const char * router_purpose_to_string (uint8_t p)
 
uint8_t router_purpose_from_string (const char *s)
 

Detailed Description

Header file for routerinfo.c.

Definition in file routerinfo.h.

Function Documentation

◆ router_get_all_orports()

smartlist_t* router_get_all_orports ( const routerinfo_t ri)

Return a smartlist of tor_addr_port_t's with all the OR ports of ri. Note that freeing of the items in the list as well as the smartlist itself is the callers responsibility.

Definition at line 39 of file routerinfo.c.

References node_get_all_orports(), and tor_assert().

Referenced by get_configured_bridge_by_routerinfo().

◆ router_get_prim_orport()

void router_get_prim_orport ( const routerinfo_t router,
tor_addr_port_t ap_out 
)

Copy the primary (IPv4) OR port (IP address and TCP port) for router into *ap_out.

Definition at line 18 of file routerinfo.c.

References routerinfo_t::addr, routerinfo_t::or_port, tor_addr_from_ipv4h, and tor_assert().

◆ router_get_verbose_nickname()

void router_get_verbose_nickname ( char *  buf,
const routerinfo_t router 
)

Set buf (which must have MAX_VERBOSE_NICKNAME_LEN+1 bytes) to the verbose representation of the identity of router. The format is: A dollar sign. The upper-case hexadecimal encoding of the SHA1 hash of router's identity. A "=" if the router is named (no longer implemented); a "~" if it is not. The router's nickname.

Definition at line 176 of file describe.c.

References base16_encode(), DIGEST_LEN, HEX_DIGEST_LEN, and signed_descriptor_t::identity_digest.

Referenced by list_server_status_v1().

◆ router_purpose_from_string()

uint8_t router_purpose_from_string ( const char *  s)

Given a string, convert it to a router purpose.

Definition at line 69 of file routerinfo.c.

Referenced by networkstatus_getinfo_by_purpose().

◆ router_purpose_to_string()

const char* router_purpose_to_string ( uint8_t  p)

Given a router purpose, convert it to a string. Don't call this on ROUTER_PURPOSE_UNKNOWN: The whole point of that value is that we don't know its string representation.

Definition at line 54 of file routerinfo.c.

References tor_assert().

Referenced by router_load_single_router().