aboutsummaryrefslogtreecommitdiff
path: root/src/or/dirserv.c
diff options
context:
space:
mode:
authorteor <teor2345@gmail.com>2017-10-15 12:09:52 -0400
committerteor <teor2345@gmail.com>2017-10-15 12:09:52 -0400
commitb8d4588c90d399b4b4487dfbacfdbe6dd415aac4 (patch)
tree7eaa02bfd3bc0325271c53039632a551bf90506c /src/or/dirserv.c
parent305f9476713b8c2d098dc6ba8098a4a9f39a86ad (diff)
downloadtor-b8d4588c90d399b4b4487dfbacfdbe6dd415aac4.tar.gz
tor-b8d4588c90d399b4b4487dfbacfdbe6dd415aac4.zip
Add a consensus_method argument to routerstatus_format_entry()
And pass ROUTERSTATUS_FORMAT_NO_CONSENSUS_METHOD when it's not applicable. Preparation for #23826.
Diffstat (limited to 'src/or/dirserv.c')
-rw-r--r--src/or/dirserv.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index ddee92da55..42ffdfa0d5 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -1897,21 +1897,28 @@ version_from_platform(const char *platform)
/** Helper: write the router-status information in <b>rs</b> into a newly
* allocated character buffer. Use the same format as in network-status
* documents. If <b>version</b> is non-NULL, add a "v" line for the platform.
+ *
+ * consensus_method is the current consensus method when format is
+ * NS_V3_CONSENSUS or NS_V3_CONSENSUS_MICRODESC. It is ignored for other
+ * formats: pass ROUTERSTATUS_FORMAT_NO_CONSENSUS_METHOD.
+ *
* Return 0 on success, -1 on failure.
*
* The format argument has one of the following values:
* NS_V2 - Output an entry suitable for a V2 NS opinion document
* NS_V3_CONSENSUS - Output the first portion of a V3 NS consensus entry
+ * for consensus_method.
* NS_V3_CONSENSUS_MICRODESC - Output the first portion of a V3 microdesc
- * consensus entry.
+ * consensus entry for consensus_method.
* NS_V3_VOTE - Output a complete V3 NS vote. If <b>vrs</b> is present,
* it contains additional information for the vote.
- * NS_CONTROL_PORT - Output a NS document for the control port
+ * NS_CONTROL_PORT - Output a NS document for the control port.
*/
char *
routerstatus_format_entry(const routerstatus_t *rs, const char *version,
const char *protocols,
routerstatus_format_type_t format,
+ int consensus_method,
const vote_routerstatus_t *vrs)
{
char *summary;