summaryrefslogtreecommitdiff
path: root/src/or/or.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-07-24 09:22:27 +0000
committerNick Mathewson <nickm@torproject.org>2008-07-24 09:22:27 +0000
commitdff1ef7d06d1f7e540be2b10e66538ab7eac3f76 (patch)
treeea39b55cfdaf59783ece60545f253951968d9d8e /src/or/or.h
parentea95ce25b63e6a291d9c816308919caf887fa7ea (diff)
downloadtor-dff1ef7d06d1f7e540be2b10e66538ab7eac3f76.tar.gz
tor-dff1ef7d06d1f7e540be2b10e66538ab7eac3f76.zip
r17337@aud-055: nickm | 2008-07-24 10:17:43 +0200
Refactor the is_vote field of networkstatus_t to add a third possibility ("opinion") in addition to vote and opinion. First part of implementing proposal 147. svn:r16166
Diffstat (limited to 'src/or/or.h')
-rw-r--r--src/or/or.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/or/or.h b/src/or/or.h
index 398d4b6b62..7f606525ae 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -1492,10 +1492,19 @@ typedef struct networkstatus_voter_info_t {
* as good. */
} networkstatus_voter_info_t;
+
+/** Enumerates the possible seriousness values of a networkstatus document. */
+typedef enum {
+ NS_TYPE_VOTE,
+ NS_TYPE_CONSENSUS,
+ NS_TYPE_OPINION,
+} networkstatus_type_t;
+
/** A common structure to hold a v3 network status vote, or a v3 network
* status consensus. */
typedef struct networkstatus_t {
- int is_vote; /**< True if this is a vote; false if it is a consensus. */
+ // int is_vote;
+ networkstatus_type_t type; /**< Vote, consensus, or opinion? */
time_t published; /**< Vote only: Tiem when vote was written. */
time_t valid_after; /**< Time after which this vote or consensus applies. */
time_t fresh_until; /**< Time before which this is the most recent vote or
@@ -4207,8 +4216,8 @@ void dump_distinct_digest_count(int severity);
networkstatus_v2_t *networkstatus_v2_parse_from_string(const char *s);
networkstatus_t *networkstatus_parse_vote_from_string(const char *s,
- const char **eos_out,
- int is_vote);
+ const char **eos_out,
+ networkstatus_type_t ns_type);
ns_detached_signatures_t *networkstatus_parse_detached_signatures(
const char *s, const char *eos);