tor  0.4.2.1-alpha-dev
Macros | Functions
describe.c File Reference
#include "core/or/or.h"
#include "feature/nodelist/describe.h"
#include "core/or/extend_info_st.h"
#include "feature/nodelist/node_st.h"
#include "feature/nodelist/routerinfo_st.h"
#include "feature/nodelist/routerstatus_st.h"
#include "feature/nodelist/microdesc_st.h"

Go to the source code of this file.

Functions

STATIC const char * format_node_description (char *buf, const char *id_digest, const char *nickname, const tor_addr_t *addr, uint32_t addr32h)
 
const char * router_describe (const routerinfo_t *ri)
 
const char * node_describe (const node_t *node)
 
const char * routerstatus_describe (const routerstatus_t *rs)
 
const char * extend_info_describe (const extend_info_t *ei)
 
void router_get_verbose_nickname (char *buf, const routerinfo_t *router)
 

Detailed Description

Format short descriptions of relays.

Definition in file describe.c.

Function Documentation

◆ extend_info_describe()

const char* extend_info_describe ( const extend_info_t ei)

Return a human-readable description of the extend_info_t ei.

This function is not thread-safe. Each call to this function invalidates previous values returned by this function.

Definition at line 204 of file describe.c.

References extend_info_t::addr, format_node_description(), extend_info_t::identity_digest, and extend_info_t::nickname.

◆ format_node_description()

STATIC const char* format_node_description ( char *  buf,
const char *  id_digest,
const char *  nickname,
const tor_addr_t addr,
uint32_t  addr32h 
)

Use buf (which must be at least NODE_DESC_BUF_LEN bytes long) to hold a human-readable description of a node with identity digest id_digest, nickname nickname, and addresses addr32h and addr.

The nickname and addr fields are optional and may be set to NULL or the null address. The addr32h field is optional and may be set to 0.

Return a pointer to the front of buf. If buf is NULL, return a string constant describing the error.

Definition at line 36 of file describe.c.

References tor_addr_is_null().

Referenced by extend_info_describe(), node_describe(), router_describe(), and routerstatus_describe().

◆ node_describe()

const char* node_describe ( const node_t node)

Return a human-readable description of the node_t node.

This function is not thread-safe. Each call to this function invalidates previous values returned by this function.

Definition at line 143 of file describe.c.

References routerinfo_t::addr, routerstatus_t::addr, format_node_description(), node_t::identity, routerstatus_t::ipv6_addr, routerinfo_t::ipv6_addr, microdesc_t::ipv6_addr, routerstatus_t::nickname, routerinfo_t::nickname, and tor_addr_is_null().

◆ router_describe()

const char* router_describe ( const routerinfo_t ri)

Return a human-readable description of the routerinfo_t ri.

This function is not thread-safe. Each call to this function invalidates previous values returned by this function.

Definition at line 123 of file describe.c.

References routerinfo_t::addr, format_node_description(), signed_descriptor_t::identity_digest, routerinfo_t::ipv6_addr, and routerinfo_t::nickname.

Referenced by directory_remove_invalid().

◆ 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 226 of file describe.c.

References MAX_VERBOSE_NICKNAME_LEN.

Referenced by list_server_status_v1().

◆ routerstatus_describe()

const char* routerstatus_describe ( const routerstatus_t rs)

Return a human-readable description of the routerstatus_t rs.

This function is not thread-safe. Each call to this function invalidates previous values returned by this function.

Definition at line 184 of file describe.c.

References routerstatus_t::addr, format_node_description(), routerstatus_t::identity_digest, routerstatus_t::ipv6_addr, and routerstatus_t::nickname.