44 const char *protocols,
51 char published[ISO_TIME_LEN+1];
56 const char *ip_str =
fmt_addr(&rs->ipv4_addr);
57 if (ip_str[0] ==
'\0')
65 "r %s %s %s%s%s %s %" PRIu16
" %" PRIu16
"\n",
90 "s%s%s%s%s%s%s%s%s%s%s%s%s\n",
102 rs->is_v2_dir?
" V2Dir":
"",
106 #define V_LINE_OVERHEAD 7
107 if (version && strlen(version) <
MAX_V_LINE_LEN - V_LINE_OVERHEAD) {
114 if (format !=
NS_V2) {
130 log_warn(
LD_BUG,
"Cannot get any descriptor for %s "
131 "(wanted descriptor %s).",
151 log_err(
LD_BUG,
"descriptor digest in routerlist does not match "
152 "the one in routerstatus: %s vs %s "
169 "w Bandwidth=%d", bw_kb);
202 time_t now = time(NULL);
215 smartlist_free(chunks);
const char * fmt_addrport(const tor_addr_t *addr, uint16_t port)
int tor_addr_is_null(const tor_addr_t *addr)
void base16_encode(char *dest, size_t destlen, const char *src, size_t srclen)
#define BASE64_DIGEST256_LEN
#define BASE64_DIGEST_LEN
int tor_memeq(const void *a, const void *b, size_t sz)
#define tor_memneq(a, b, sz)
Header file for dirvote.c.
Format routerstatus entries for controller, vote, or consensus.
routerstatus_format_type_t
@ NS_V3_CONSENSUS_MICRODESC
char * routerstatus_format_entry(const routerstatus_t *rs, const char *version, const char *protocols, routerstatus_format_type_t format, const vote_routerstatus_t *vrs)
Master header file for Tor-specific functionality.
char * policy_summarize(smartlist_t *policy, sa_family_t family)
Header file for policies.c.
double rep_hist_get_stability(const char *id, time_t when)
double rep_hist_get_weighted_fractional_uptime(const char *id, time_t when)
long rep_hist_get_weighted_time_known(const char *id, time_t when)
Header file for rephist.c.
Router descriptor structure.
const routerinfo_t * router_get_by_id_digest(const char *digest)
uint32_t router_get_advertised_bandwidth_capped(const routerinfo_t *router)
Header file for routerlist.c.
void smartlist_add_asprintf(struct smartlist_t *sl, const char *pattern,...)
char * smartlist_join_strings(smartlist_t *sl, const char *join, int terminate, size_t *len_out)
smartlist_t * smartlist_new(void)
void smartlist_add_strdup(struct smartlist_t *sl, const char *string)
#define SMARTLIST_FOREACH(sl, type, var, cmd)
smartlist_t * exit_policy
unsigned int is_staledesc
char descriptor_digest[DIGEST256_LEN]
char identity_digest[DIGEST_LEN]
unsigned int has_guardfraction
char nickname[MAX_NICKNAME_LEN+1]
unsigned int has_bandwidth
unsigned int is_possible_guard
unsigned int is_flagged_running
unsigned int is_authority
uint32_t guardfraction_percentage
char signed_descriptor_digest[DIGEST_LEN]
uint8_t ed25519_id[ED25519_PUBKEY_LEN]
unsigned int has_measured_bw
void format_iso_time(char *buf, time_t t)
int fast_mem_is_zero(const char *mem, size_t len)
Routerstatus (vote entry) structure.
#define ED25519_PUBKEY_LEN