Implements ticket 8151.
--- /dev/null
+ o Minor features (directory authority):
+ - Include inside each vote a statement of the performance
+ thresholds that made the authority vote for its flags. Implements
+ ticket 8151.
+
\ No newline at end of file
tor_free(wfus);
}
+/** Give a statement of our current performance thresholds for inclusion
+ * in a vote document. */
+char *
+dirserv_get_flag_thresholds_line(void)
+{
+ char *result=NULL;
+ tor_asprintf(&result,
+ "stable-uptime=%lu stable-mtbf=%lu "
+ "fast-speed=%lu "
+ "guard-wfu=%.03f%% guard-tk=%lu "
+ "guard-bw-inc-exits=%lu guard-bw-exc-exits=%lu "
+ "enough-mtbf=%d",
+ (unsigned long)stable_uptime,
+ (unsigned long)stable_mtbf,
+ (unsigned long)fast_bandwidth,
+ guard_wfu*100,
+ (unsigned long)guard_tk,
+ (unsigned long)guard_bandwidth_including_exits,
+ (unsigned long)guard_bandwidth_excluding_exits,
+ enough_mtbf_info ? 1 : 0);
+
+ return result;
+}
+
/** Given a platform string as in a routerinfo_t (possibly null), return a
* newly allocated version string for a networkstatus document, or NULL if the
* platform doesn't give a Tor version. */
int for_controller);
int dirserv_dump_directory_to_string(char **dir_out,
crypto_pk_t *private_key);
+char *dirserv_get_flag_thresholds_line(void);
int directory_fetches_from_authorities(const or_options_t *options);
int directory_fetches_dir_info_early(const or_options_t *options);
char fu[ISO_TIME_LEN+1];
char vu[ISO_TIME_LEN+1];
char *flags = smartlist_join_strings(v3_ns->known_flags, " ", 0, NULL);
+ /* XXXX Abstraction violation: should be pulling a field out of v3_ns.*/
+ char *flag_thresholds = dirserv_get_flag_thresholds_line();
char *params;
authority_cert_t *cert = v3_ns->cert;
char *methods =
"voting-delay %d %d\n"
"%s" /* versions */
"known-flags %s\n"
+ "flag-thresholds %s\n"
"params %s\n"
"dir-source %s %s %s %s %d %d\n"
"contact %s\n",
v3_ns->vote_seconds, v3_ns->dist_seconds,
version_lines,
flags,
+ flag_thresholds,
params,
voter->nickname, fingerprint, voter->address,
fmt_addr32(addr), voter->dir_port, voter->or_port,
tor_free(params);
tor_free(flags);
+ tor_free(flag_thresholds);
tor_free(methods);
outp = status + strlen(status);
endp = status + len;