Tor  0.4.6.0-alpha-dev
Macros | Functions
describe.c File Reference

Format short descriptions of relays. More...

#include "core/or/or.h"
#include "core/or/extendinfo.h"
#include "feature/nodelist/describe.h"
#include "feature/nodelist/nodelist.h"
#include "feature/nodelist/routerinfo.h"
#include "lib/crypt_ops/crypto_ed25519.h"
#include "lib/crypt_ops/crypto_format.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 *rsa_id_digest, const ed25519_public_key_t *ed25519_id, const char *nickname, const tor_addr_t *ipv4_addr, const tor_addr_t *ipv6_addr)
 
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 224 of file describe.c.

◆ format_node_description()

STATIC const char* format_node_description ( char *  buf,
const char *  rsa_id_digest,
const ed25519_public_key_t ed25519_id,
const char *  nickname,
const tor_addr_t ipv4_addr,
const tor_addr_t ipv6_addr 
)

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, ipv6_addr and ipv4_addr fields are optional and may be set to NULL or the null address.

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

Definition at line 40 of file describe.c.

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

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

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

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