12 #define DESCRIBE_PRIVATE
41 const char *rsa_id_digest,
49 bool valid_ipv4 =
false;
52 return "<NULL BUFFER>";
54 memset(buf, 0, NODE_DESC_BUF_LEN);
59 rv = strlcpy(buf,
"<NULL ID DIGEST>", NODE_DESC_BUF_LEN);
60 tor_assert_nonfatal(rv < NODE_DESC_BUF_LEN);
66 rv = strlcat(buf,
"$", NODE_DESC_BUF_LEN);
67 tor_assert_nonfatal(rv < NODE_DESC_BUF_LEN);
71 memset(hex_digest, 0,
sizeof(hex_digest));
75 rv = strlcat(buf, hex_digest, NODE_DESC_BUF_LEN);
76 tor_assert_nonfatal(rv < NODE_DESC_BUF_LEN);
80 rv = strlcat(buf,
"~", NODE_DESC_BUF_LEN);
81 tor_assert_nonfatal(rv < NODE_DESC_BUF_LEN);
82 rv = strlcat(buf, nickname, NODE_DESC_BUF_LEN);
83 tor_assert_nonfatal(rv < NODE_DESC_BUF_LEN);
88 rv = strlcat(buf,
" [", NODE_DESC_BUF_LEN);
89 tor_assert_nonfatal(rv < NODE_DESC_BUF_LEN);
90 rv = strlcat(buf, ed_base64, NODE_DESC_BUF_LEN);
91 tor_assert_nonfatal(rv < NODE_DESC_BUF_LEN);
92 rv = strlcat(buf,
"]", NODE_DESC_BUF_LEN);
93 tor_assert_nonfatal(rv < NODE_DESC_BUF_LEN);
95 if (ipv4_addr || has_ipv6) {
96 rv = strlcat(buf,
" at ", NODE_DESC_BUF_LEN);
97 tor_assert_nonfatal(rv < NODE_DESC_BUF_LEN);
100 const char *str_rv = NULL;
102 memset(addr_str, 0,
sizeof(addr_str));
106 rv = strlcat(buf, addr_str, NODE_DESC_BUF_LEN);
107 tor_assert_nonfatal(rv < NODE_DESC_BUF_LEN);
112 if (valid_ipv4 && has_ipv6) {
113 rv = strlcat(buf,
" and ", NODE_DESC_BUF_LEN);
114 tor_assert_nonfatal(rv < NODE_DESC_BUF_LEN);
117 const char *str_rv = NULL;
119 memset(addr_str, 0,
sizeof(addr_str));
123 rv = strlcat(buf, addr_str, NODE_DESC_BUF_LEN);
124 tor_assert_nonfatal(rv < NODE_DESC_BUF_LEN);
139 static char buf[NODE_DESC_BUF_LEN];
162 static char buf[NODE_DESC_BUF_LEN];
163 const char *nickname = NULL;
164 const tor_addr_t *ipv6_addr = NULL, *ipv4_addr = NULL;
171 ipv4_addr = &node->rs->ipv4_addr;
179 }
else if (node->ri) {
184 return "<null rs and ri>";
205 static char buf[NODE_DESC_BUF_LEN];
226 static char buf[NODE_DESC_BUF_LEN];
233 const tor_addr_t *addr4 = ap4 ? &ap4->addr : NULL;
234 const tor_addr_t *addr6 = ap6 ? &ap6->addr : NULL;
280 memset(hex_digest, 0,
sizeof(hex_digest));
const char * tor_addr_to_str(char *dest, const tor_addr_t *addr, size_t len, int decorate)
int tor_addr_is_null(const tor_addr_t *addr)
void base16_encode(char *dest, size_t destlen, const char *src, size_t srclen)
int ed25519_public_key_is_zero(const ed25519_public_key_t *pubkey)
Header for crypto_ed25519.c.
void router_get_verbose_nickname(char *buf, const routerinfo_t *router)
const char * router_describe(const routerinfo_t *ri)
const char * extend_info_describe(const extend_info_t *ei)
const char * routerstatus_describe(const routerstatus_t *rs)
const char * node_describe(const node_t *node)
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)
Header file for describe.c.
const tor_addr_port_t * extend_info_get_orport(const extend_info_t *ei, int family)
Header for core/or/extendinfo.c.
Microdescriptor structure.
Node information structure.
const ed25519_public_key_t * node_get_ed25519_id(const node_t *node)
Header file for nodelist.c.
Master header file for Tor-specific functionality.
#define MAX_VERBOSE_NICKNAME_LEN
const ed25519_public_key_t * routerinfo_get_ed25519_id(const routerinfo_t *ri)
Header file for routerinfo.c.
Router descriptor structure.
Routerstatus (consensus entry) structure.
ed25519_public_key_t ed_identity
char identity_digest[DIGEST_LEN]
char nickname[MAX_HEX_NICKNAME_LEN+1]
char identity[DIGEST_LEN]
char identity_digest[DIGEST_LEN]
char nickname[MAX_NICKNAME_LEN+1]
char identity_digest[DIGEST_LEN]
#define ED25519_BASE64_LEN