Tor
0.4.7.0-alpha-dev
|
Format routerstatus entries for controller, vote, or consensus. More...
Go to the source code of this file.
Macros | |
#define | MAX_V_LINE_LEN 128 |
Enumerations | |
enum | routerstatus_format_type_t { NS_V2 , NS_V3_CONSENSUS , NS_V3_VOTE , NS_CONTROL_PORT , NS_V3_CONSENSUS_MICRODESC } |
Functions | |
char * | routerstatus_format_entry (const routerstatus_t *rs, const char *version, const char *protocols, routerstatus_format_type_t format, const vote_routerstatus_t *vrs) |
Format routerstatus entries for controller, vote, or consensus.
Header file for fmt_routerstatus.c.
(Because controllers consume this format, we can't make this code dirauth-only.)
Definition in file fmt_routerstatus.h.
#define MAX_V_LINE_LEN 128 |
Maximum allowable length of a version line in a networkstatus.
Definition at line 31 of file fmt_routerstatus.h.
An enum to describe what format we're generating a routerstatus line in.
Definition at line 17 of file fmt_routerstatus.h.
char* routerstatus_format_entry | ( | const routerstatus_t * | rs, |
const char * | version, | ||
const char * | protocols, | ||
routerstatus_format_type_t | format, | ||
const vote_routerstatus_t * | vrs | ||
) |
Helper: write the router-status information in rs into a newly allocated character buffer. Use the same format as in network-status documents. If version is non-NULL, add a "v" line for the platform.
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 for consensus_method. NS_V3_VOTE - Output a complete V3 NS vote. If vrs is present, it contains additional information for the vote. NS_CONTROL_PORT - Output a NS document for the control port.
Definition at line 43 of file fmt_routerstatus.c.
Referenced by networkstatus_getinfo_helper_single().