Tor 0.4.9.0-alpha-dev
Functions
routerinfo.c File Reference

Manipulate full router descriptors. More...

#include "core/or/or.h"
#include "feature/nodelist/nodelist.h"
#include "feature/nodelist/routerinfo.h"
#include "feature/nodelist/torcert.h"
#include "feature/nodelist/node_st.h"
#include "feature/nodelist/routerinfo_st.h"

Go to the source code of this file.

Functions

int router_get_orport (const routerinfo_t *router, tor_addr_port_t *ap_out, int family)
 
int router_has_orport (const routerinfo_t *router, const tor_addr_port_t *orport)
 
smartlist_trouter_get_all_orports (const routerinfo_t *ri)
 
const ed25519_public_key_trouterinfo_get_ed25519_id (const routerinfo_t *ri)
 
const char * router_purpose_to_string (uint8_t p)
 
uint8_t router_purpose_from_string (const char *s)
 

Detailed Description

Manipulate full router descriptors.

Definition in file routerinfo.c.

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 68 of file routerinfo.c.

Referenced by get_configured_bridge_by_routerinfo().

◆ router_get_orport()

int router_get_orport ( const routerinfo_t router,
tor_addr_port_t ap_out,
int  family 
)

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

If the requested ORPort does not exist, sets *ap_out to the null address and port, and returns -1. Otherwise, returns 0.

Definition at line 27 of file routerinfo.c.

Referenced by have_orport_for_family(), and router_orport_found_reachable().

◆ router_has_orport()

int router_has_orport ( const routerinfo_t router,
const tor_addr_port_t orport 
)

Definition at line 55 of file routerinfo.c.

◆ 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 113 of file routerinfo.c.

Referenced by handle_control_postdescriptor(), and 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 98 of file routerinfo.c.

Referenced by router_load_single_router().

◆ routerinfo_get_ed25519_id()

const ed25519_public_key_t * routerinfo_get_ed25519_id ( const routerinfo_t ri)

Return the Ed25519 identity key for this routerinfo, or NULL if it doesn't have one.

Definition at line 82 of file routerinfo.c.

Referenced by router_describe().