[or-cvs] r13383: As planned, rename networkstatus_vote_t to networkstatus_t, (in tor/trunk: . src/or)

nickm at seul.org nickm at seul.org
Tue Feb 5 21:39:30 UTC 2008


Author: nickm
Date: 2008-02-05 16:39:29 -0500 (Tue, 05 Feb 2008)
New Revision: 13383

Modified:
   tor/trunk/
   tor/trunk/src/or/control.c
   tor/trunk/src/or/directory.c
   tor/trunk/src/or/dirserv.c
   tor/trunk/src/or/dirvote.c
   tor/trunk/src/or/main.c
   tor/trunk/src/or/networkstatus.c
   tor/trunk/src/or/or.h
   tor/trunk/src/or/rendservice.c
   tor/trunk/src/or/routerlist.c
   tor/trunk/src/or/routerparse.c
   tor/trunk/src/or/test.c
Log:
 r17909 at catbus:  nickm | 2008-02-05 14:48:22 -0500
 As planned, rename networkstatus_vote_t to networkstatus_t, now that v3 networkstatuses are working and standard and v2 networkstatuses are obsolete.



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r17909] on 8246c3cf-6607-4228-993b-4d95d33730f1

Modified: tor/trunk/src/or/control.c
===================================================================
--- tor/trunk/src/or/control.c	2008-02-05 19:40:26 UTC (rev 13382)
+++ tor/trunk/src/or/control.c	2008-02-05 21:39:29 UTC (rev 13383)
@@ -1684,7 +1684,7 @@
                    check_whether_dirport_reachable() ? 1 : 0);
     } else if (!strcmpstart(question, "status/version/")) {
       int is_server = server_mode(get_options());
-      networkstatus_vote_t *c = networkstatus_get_latest_consensus();
+      networkstatus_t *c = networkstatus_get_latest_consensus();
       version_status_t status;
       const char *recommended;
       if (c) {

Modified: tor/trunk/src/or/directory.c
===================================================================
--- tor/trunk/src/or/directory.c	2008-02-05 19:40:26 UTC (rev 13382)
+++ tor/trunk/src/or/directory.c	2008-02-05 21:39:29 UTC (rev 13383)
@@ -323,7 +323,7 @@
   }
 
   if (DIR_PURPOSE_FETCH_CONSENSUS) {
-    networkstatus_vote_t *v = networkstatus_get_latest_consensus();
+    networkstatus_t *v = networkstatus_get_latest_consensus();
     if (v)
       if_modified_since = v->valid_after + 180;
   }
@@ -2272,7 +2272,7 @@
       else
         request_type = "/tor/status/?";
     } else {
-      networkstatus_vote_t *v = networkstatus_get_latest_consensus();
+      networkstatus_t *v = networkstatus_get_latest_consensus();
       time_t now = time(NULL);
       smartlist_add(dir_fps, tor_memdup("\0\0\0\0\0\0\0\0\0\0"
                                         "\0\0\0\0\0\0\0\0\0\0", 20));

Modified: tor/trunk/src/or/dirserv.c
===================================================================
--- tor/trunk/src/or/dirserv.c	2008-02-05 19:40:26 UTC (rev 13382)
+++ tor/trunk/src/or/dirserv.c	2008-02-05 21:39:29 UTC (rev 13383)
@@ -2105,14 +2105,14 @@
  * information is not accurate. */
 #define DIRSERV_TIME_TO_GET_REACHABILITY_INFO (30*60)
 
-/** Return a new networkstatus_vote_t* containing our current opinion. (For v3
+/** Return a new networkstatus_t* containing our current opinion. (For v3
  * authorities) */
-networkstatus_vote_t *
+networkstatus_t *
 dirserv_generate_networkstatus_vote_obj(crypto_pk_env_t *private_key,
                                         authority_cert_t *cert)
 {
   or_options_t *options = get_options();
-  networkstatus_vote_t *v3_out = NULL;
+  networkstatus_t *v3_out = NULL;
   uint32_t addr;
   char *hostname = NULL, *client_versions = NULL, *server_versions = NULL;
   const char *contact;
@@ -2206,14 +2206,14 @@
   smartlist_free(routers);
   digestmap_free(omit_as_sybil, NULL);
 
-  v3_out = tor_malloc_zero(sizeof(networkstatus_vote_t));
+  v3_out = tor_malloc_zero(sizeof(networkstatus_t));
 
   v3_out->is_vote = 1;
   dirvote_get_preferred_voting_intervals(&timing);
   v3_out->published = now;
   {
     char tbuf[ISO_TIME_LEN+1];
-    networkstatus_vote_t *current_consensus =
+    networkstatus_t *current_consensus =
       networkstatus_get_live_consensus(now);
     time_t last_consensus_interval; /* only used to pick a valid_after */
     if (current_consensus)

Modified: tor/trunk/src/or/dirvote.c
===================================================================
--- tor/trunk/src/or/dirvote.c	2008-02-05 19:40:26 UTC (rev 13382)
+++ tor/trunk/src/or/dirvote.c	2008-02-05 21:39:29 UTC (rev 13383)
@@ -34,7 +34,7 @@
  * For v3 authorities. */
 char *
 format_networkstatus_vote(crypto_pk_env_t *private_signing_key,
-                          networkstatus_vote_t *v3_ns)
+                          networkstatus_t *v3_ns)
 {
 /** Longest status flag name that we generate. */
 #define LONGEST_STATUS_FLAG_NAME_LEN 9
@@ -188,7 +188,7 @@
   }
 
   {
-    networkstatus_vote_t *v;
+    networkstatus_t *v;
     if (!(v = networkstatus_parse_vote_from_string(status, NULL, 1))) {
       log_err(LD_BUG,"Generated a networkstatus vote we couldn't parse: "
               "<<%s>>", status);
@@ -213,7 +213,7 @@
 /** Given a vote <b>vote</b> (not a consensus!), return its associated
  * networkstatus_voter_info_t. */
 static networkstatus_voter_info_t *
-get_voter(const networkstatus_vote_t *vote)
+get_voter(const networkstatus_t *vote)
 {
   tor_assert(vote);
   tor_assert(vote->is_vote);
@@ -222,12 +222,12 @@
   return smartlist_get(vote->voters, 0);
 }
 
-/** Helper for sorting networkstatus_vote_t votes (not consensuses) by the
+/** Helper for sorting networkstatus_t votes (not consensuses) by the
  * hash of their voters' identity digests. */
 static int
 _compare_votes_by_authority_id(const void **_a, const void **_b)
 {
-  const networkstatus_vote_t *a = *_a, *b = *_b;
+  const networkstatus_t *a = *_a, *b = *_b;
   return memcmp(get_voter(a)->identity_digest,
                 get_voter(b)->identity_digest, DIGEST_LEN);
 }
@@ -396,7 +396,7 @@
   int min = (smartlist_len(votes) * 2) / 3;
   int n_ok;
   int result;
-  SMARTLIST_FOREACH(votes, networkstatus_vote_t *, vote,
+  SMARTLIST_FOREACH(votes, networkstatus_t *, vote,
   {
     tor_assert(vote->supported_methods);
     smartlist_add_all(tmp, vote->supported_methods);
@@ -428,7 +428,7 @@
   return (method >= 1) && (method <= 2);
 }
 
-/** Given a list of vote networkstatus_vote_t in <b>votes</b>, our public
+/** Given a list of vote networkstatus_t in <b>votes</b>, our public
  * authority <b>identity_key</b>, our private authority <b>signing_key</b>,
  * and the number of <b>total_authorities</b> that we believe exist in our
  * voting quorum, generate the text of a new v3 consensus vote, and return the
@@ -482,7 +482,7 @@
     smartlist_t *combined_client_versions = smartlist_create();
     smartlist_t *combined_server_versions = smartlist_create();
     int j;
-    SMARTLIST_FOREACH(votes, networkstatus_vote_t *, v,
+    SMARTLIST_FOREACH(votes, networkstatus_t *, v,
     {
       tor_assert(v->is_vote);
       va_times[v_sl_idx] = v->valid_after;
@@ -590,7 +590,7 @@
   /* Sort the votes. */
   smartlist_sort(votes, _compare_votes_by_authority_id);
   /* Add the authority sections. */
-  SMARTLIST_FOREACH(votes, networkstatus_vote_t *, v,
+  SMARTLIST_FOREACH(votes, networkstatus_t *, v,
   {
     char buf[1024];
     struct in_addr in;
@@ -658,7 +658,7 @@
     chosen_unnamed_idx = smartlist_string_pos(flags, "Unnamed");
 
     /* Build the flag index. */
-    SMARTLIST_FOREACH(votes, networkstatus_vote_t *, v,
+    SMARTLIST_FOREACH(votes, networkstatus_t *, v,
     {
       flag_map[v_sl_idx] = tor_malloc_zero(
                            sizeof(int)*smartlist_len(v->known_flags));
@@ -679,7 +679,7 @@
 
     /* Named and Unnamed get treated specially */
     if (consensus_method >= 2) {
-      SMARTLIST_FOREACH(votes, networkstatus_vote_t *, v,
+      SMARTLIST_FOREACH(votes, networkstatus_t *, v,
       {
         uint64_t nf;
         if (named_flag[v_sl_idx]<0)
@@ -703,7 +703,7 @@
           }
         });
       });
-      SMARTLIST_FOREACH(votes, networkstatus_vote_t *, v,
+      SMARTLIST_FOREACH(votes, networkstatus_t *, v,
       {
         uint64_t uf;
         if (unnamed_flag[v_sl_idx]<0)
@@ -744,7 +744,7 @@
       char buf[256];
 
       /* Of the next-to-be-considered digest in each voter, which is first? */
-      SMARTLIST_FOREACH(votes, networkstatus_vote_t *, v, {
+      SMARTLIST_FOREACH(votes, networkstatus_t *, v, {
         if (index[v_sl_idx] < size[v_sl_idx]) {
           rs = smartlist_get(v->routerstatus_list, index[v_sl_idx]);
           if (!lowest_id ||
@@ -761,7 +761,7 @@
       smartlist_clear(versions);
 
       /* Okay, go through all the entries for this digest. */
-      SMARTLIST_FOREACH(votes, networkstatus_vote_t *, v, {
+      SMARTLIST_FOREACH(votes, networkstatus_t *, v, {
         if (index[v_sl_idx] >= size[v_sl_idx])
           continue; /* out of entries. */
         rs = smartlist_get(v->routerstatus_list, index[v_sl_idx]);
@@ -924,7 +924,7 @@
   smartlist_free(chunks);
 
   {
-    networkstatus_vote_t *c;
+    networkstatus_t *c;
     if (!(c = networkstatus_parse_vote_from_string(result, NULL, 0))) {
       log_err(LD_BUG,"Generated a networkstatus consensus we couldn't "
               "parse.");
@@ -946,7 +946,7 @@
  * changed, or -1 if the document signed by <b>sigs</b> isn't the same
  * document as <b>target</b>. */
 int
-networkstatus_add_detached_signatures(networkstatus_vote_t *target,
+networkstatus_add_detached_signatures(networkstatus_t *target,
                                       ns_detached_signatures_t *sigs,
                                       const char **msg_out)
 {
@@ -1035,7 +1035,7 @@
 /** Return a newly allocated string holding the detached-signatures document
  * corresponding to the signatures on <b>consensus</b>. */
 char *
-networkstatus_get_detached_signatures(networkstatus_vote_t *consensus)
+networkstatus_get_detached_signatures(networkstatus_t *consensus)
 {
   smartlist_t *elements;
   char buf[4096];
@@ -1220,7 +1220,7 @@
   int interval, vote_delay, dist_delay;
   time_t start;
   time_t end;
-  networkstatus_vote_t *consensus;
+  networkstatus_t *consensus;
 
   if (!authdir_mode_v3(options))
     return;
@@ -1315,12 +1315,12 @@
   }
 }
 
-/** A vote networkstatus_vote_t and its unparsed body: held around so we can
+/** A vote networkstatus_t and its unparsed body: held around so we can
  * use it to generate a consensus (at voting_ends) and so we can serve it to
  * other authorities that might want it. */
 typedef struct pending_vote_t {
   cached_dir_t *vote_body;
-  networkstatus_vote_t *vote;
+  networkstatus_t *vote;
 } pending_vote_t;
 
 /** List of pending_vote_t for the current vote.  Before we've used them to
@@ -1336,7 +1336,7 @@
  * building. */
 static char *pending_consensus_signatures = NULL;
 /** The parsed in-progress consensus document. */
-static networkstatus_vote_t *pending_consensus = NULL;
+static networkstatus_t *pending_consensus = NULL;
 /** List of ns_detached_signatures_t: hold signatures that get posted to us
  * before we have generated the consensus on our own. */
 static smartlist_t *pending_consensus_signature_list = NULL;
@@ -1348,7 +1348,7 @@
 {
   crypto_pk_env_t *key = get_my_v3_authority_signing_key();
   authority_cert_t *cert = get_my_v3_authority_cert();
-  networkstatus_vote_t *ns;
+  networkstatus_t *ns;
   char *contents;
   pending_vote_t *pending_vote;
 
@@ -1507,7 +1507,7 @@
 pending_vote_t *
 dirvote_add_vote(const char *vote_body, const char **msg_out, int *status_out)
 {
-  networkstatus_vote_t *vote;
+  networkstatus_t *vote;
   networkstatus_voter_info_t *vi;
   trusted_dir_server_t *ds;
   pending_vote_t *pending_vote = NULL;
@@ -1664,7 +1664,7 @@
   int n_votes, n_voters;
   smartlist_t *votes = NULL;
   char *consensus_body = NULL, *signatures = NULL;
-  networkstatus_vote_t *consensus = NULL;
+  networkstatus_t *consensus = NULL;
   authority_cert_t *my_cert;
 
   if (!pending_vote_list)
@@ -1813,7 +1813,7 @@
     {
       ns_detached_signatures_t *sigs =
         networkstatus_parse_detached_signatures(new_detached, NULL);
-      networkstatus_vote_t *v = networkstatus_parse_vote_from_string(
+      networkstatus_t *v = networkstatus_parse_vote_from_string(
                                              pending_consensus_body, NULL, 0);
       tor_assert(sigs);
       ns_detached_signatures_free(sigs);

Modified: tor/trunk/src/or/main.c
===================================================================
--- tor/trunk/src/or/main.c	2008-02-05 19:40:26 UTC (rev 13382)
+++ tor/trunk/src/or/main.c	2008-02-05 21:39:29 UTC (rev 13383)
@@ -936,7 +936,7 @@
   /* 1f. Check whether our networkstatus has expired.
    */
   if (time_to_check_for_expired_networkstatus < now) {
-    networkstatus_vote_t *ns = networkstatus_get_latest_consensus();
+    networkstatus_t *ns = networkstatus_get_latest_consensus();
     /*XXXX020 this value needs to be the same as REASONABLY_LIVE_TIME in
      * networkstatus_get_reasonably_live_consensus(), but that value is way
      * way too high.  Arma: is the bridge issue there resolved yet? -NM */

Modified: tor/trunk/src/or/networkstatus.c
===================================================================
--- tor/trunk/src/or/networkstatus.c	2008-02-05 19:40:26 UTC (rev 13382)
+++ tor/trunk/src/or/networkstatus.c	2008-02-05 21:39:29 UTC (rev 13383)
@@ -33,11 +33,11 @@
 static strmap_t *unnamed_server_map = NULL;
 
 /** Most recently received and validated v3 consensus network status. */
-static networkstatus_vote_t *current_consensus = NULL;
+static networkstatus_t *current_consensus = NULL;
 
 /** A v3 consensus networkstatus that we've received, but which we don't
  * have enough certificates to be happy about. */
-static networkstatus_vote_t *consensus_waiting_for_certs = NULL;
+static networkstatus_t *consensus_waiting_for_certs = NULL;
 static char *consensus_waiting_for_certs_body = NULL;
 static time_t consensus_waiting_for_certs_set_at = 0;
 static int consensus_waiting_for_certs_dl_failed = 0;
@@ -263,7 +263,7 @@
 
 /** Clear all storage held in <b>ns</b>. */
 void
-networkstatus_vote_free(networkstatus_vote_t *ns)
+networkstatus_vote_free(networkstatus_t *ns)
 {
   if (!ns)
     return;
@@ -317,7 +317,7 @@
  * is <b>identity</b>, or NULL if no such voter is associated with
  * <b>vote</b>. */
 networkstatus_voter_info_t *
-networkstatus_get_voter_by_id(networkstatus_vote_t *vote,
+networkstatus_get_voter_by_id(networkstatus_t *vote,
                               const char *identity)
 {
   if (!vote || !vote->voters)
@@ -334,7 +334,7 @@
  * <b>voter</b>, and return 0. */
 /* (private; exposed for testing.) */
 int
-networkstatus_check_voter_signature(networkstatus_vote_t *consensus,
+networkstatus_check_voter_signature(networkstatus_t *consensus,
                                     networkstatus_voter_info_t *voter,
                                     authority_cert_t *cert)
 {
@@ -370,7 +370,7 @@
  * about every problem; if warn is at least 1, warn only if we can't get
  * enough signatures; if warn is negative, log nothing at all. */
 int
-networkstatus_check_consensus_signature(networkstatus_vote_t *consensus,
+networkstatus_check_consensus_signature(networkstatus_t *consensus,
                                         int warn)
 {
   int n_good = 0;
@@ -777,7 +777,7 @@
 /** Return the entry in <b>ns</b> for the identity digest <b>digest</b>, or
  * NULL if none was found. */
 routerstatus_t *
-networkstatus_vote_find_entry(networkstatus_vote_t *ns, const char *digest)
+networkstatus_vote_find_entry(networkstatus_t *ns, const char *digest)
 {
   return smartlist_bsearch(ns->routerstatus_list, digest,
                            _compare_digest_to_routerstatus_entry);
@@ -786,7 +786,7 @@
 /*XXXX020 make this static once functions are moved into this file. */
 /** DOCDOC */
 int
-networkstatus_vote_find_entry_idx(networkstatus_vote_t *ns,
+networkstatus_vote_find_entry_idx(networkstatus_t *ns,
                                   const char *digest, int *found_out)
 {
   return smartlist_bsearch_idx(ns->routerstatus_list, digest,
@@ -1079,7 +1079,7 @@
 update_consensus_networkstatus_fetch_time(time_t now)
 {
   or_options_t *options = get_options();
-  networkstatus_vote_t *c = networkstatus_get_live_consensus(now);
+  networkstatus_t *c = networkstatus_get_live_consensus(now);
   if (c) {
     long dl_interval;
     long interval = c->fresh_until - c->valid_after;
@@ -1184,7 +1184,7 @@
 
 /** Return the most recent consensus that we have downloaded, or NULL if we
  * don't have one. */
-networkstatus_vote_t *
+networkstatus_t *
 networkstatus_get_latest_consensus(void)
 {
   return current_consensus;
@@ -1192,7 +1192,7 @@
 
 /** Return the most recent consensus that we have downloaded, or NULL if it is
  * no longer live. */
-networkstatus_vote_t *
+networkstatus_t *
 networkstatus_get_live_consensus(time_t now)
 {
   if (current_consensus &&
@@ -1206,7 +1206,7 @@
 /* XXXX020 remove this in favor of get_live_consensus. But actually,
  * leave something like it for bridge users, who need to not totally
  * lose if they spend a while fetching a new consensus. */
-networkstatus_vote_t *
+networkstatus_t *
 networkstatus_get_reasonably_live_consensus(time_t now)
 {
 #define REASONABLY_LIVE_TIME (24*60*60)
@@ -1253,8 +1253,8 @@
 /** Notify controllers of any router status entries that changed between
  * <b>old_c</b> and <b>new_c</b>. */
 static void
-notify_control_networkstatus_changed(const networkstatus_vote_t *old_c,
-                                     const networkstatus_vote_t *new_c)
+notify_control_networkstatus_changed(const networkstatus_t *old_c,
+                                     const networkstatus_t *new_c)
 {
   int idx = 0;
   int old_remain = old_c && smartlist_len(old_c->routerstatus_list);
@@ -1292,8 +1292,8 @@
 /** Copy all the ancillary information (like router download status and so on)
  * from <b>old_c</b> to <b>new_c</b>. */
 static void
-networkstatus_copy_old_consensus_info(networkstatus_vote_t *new_c,
-                                      const networkstatus_vote_t *old_c)
+networkstatus_copy_old_consensus_info(networkstatus_t *new_c,
+                                      const networkstatus_t *old_c)
 {
   int idx = 0;
   const routerstatus_t *rs_old;
@@ -1344,7 +1344,7 @@
 int
 networkstatus_set_current_consensus(const char *consensus, unsigned flags)
 {
-  networkstatus_vote_t *c;
+  networkstatus_t *c;
   int r, result = -1;
   time_t now = time(NULL);
   char *unverified_fname = NULL, *consensus_fname = NULL;
@@ -1526,7 +1526,7 @@
 {
   routerinfo_t *me;
   routerlist_t *rl = router_get_routerlist();
-  networkstatus_vote_t *consensus = networkstatus_get_live_consensus(now);
+  networkstatus_t *consensus = networkstatus_get_live_consensus(now);
   or_options_t *options = get_options();
 
   if (networkstatus_v2_list_has_changed)
@@ -1675,7 +1675,7 @@
   or_options_t *options = get_options();
   int authdir = authdir_mode_v2(options) || authdir_mode_v3(options);
   int namingdir = authdir && options->NamingAuthoritativeDir;
-  networkstatus_vote_t *ns = current_consensus;
+  networkstatus_t *ns = current_consensus;
   int idx;
   if (!ns || !smartlist_len(ns->routerstatus_list))
     return;
@@ -1751,7 +1751,7 @@
 void
 signed_descs_update_status_from_consensus_networkstatus(smartlist_t *descs)
 {
-  networkstatus_vote_t *ns = current_consensus;
+  networkstatus_t *ns = current_consensus;
   if (!ns)
     return;
 

Modified: tor/trunk/src/or/or.h
===================================================================
--- tor/trunk/src/or/or.h	2008-02-05 19:40:26 UTC (rev 13382)
+++ tor/trunk/src/or/or.h	2008-02-05 21:39:29 UTC (rev 13383)
@@ -1436,7 +1436,7 @@
   routerstatus_t status; /**< Underlying 'status' object for this router.
                           * Flags are redundant. */
   uint64_t flags; /**< Bit-field for all recognized flags; index into
-                   * networkstatus_vote_t.known_flags. */
+                   * networkstatus_t.known_flags. */
   char *version; /**< The version that the authority says this router is
                   * running. */
 } vote_routerstatus_t;
@@ -1463,11 +1463,9 @@
                                     * the sig, and we know it's bad. */
 } networkstatus_voter_info_t;
 
-/** A common structure to hold a v2 network status vote, or a v2 network
+/** A common structure to hold a v3 network status vote, or a v3 network
  * status consensus. */
-/* XXXX020 rename to networkstatus_t once it replaces networkstatus_t in
- * functionality. */
-typedef struct networkstatus_vote_t {
+typedef struct networkstatus_t {
   int is_vote; /**< True if this is a vote; false if it is a consensus. */
   time_t published; /**< Vote only: Tiem when vote was written. */
   time_t valid_after; /**< Time after which this vote or consensus applies. */
@@ -1514,10 +1512,10 @@
   /** If present, a map from descriptor digest to elements of
    * routerstatus_list. */
   digestmap_t *desc_digest_map;
-} networkstatus_vote_t;
+} networkstatus_t;
 
 /** A set of signatures for a networkstatus consensus.  All fields are as for
- * networkstatus_vote_t. */
+ * networkstatus_t. */
 typedef struct ns_detached_signatures_t {
   time_t valid_after;
   time_t fresh_until;
@@ -3142,10 +3140,10 @@
                                       int total_authorities,
                                       crypto_pk_env_t *identity_key,
                                       crypto_pk_env_t *signing_key);
-int networkstatus_add_detached_signatures(networkstatus_vote_t *target,
+int networkstatus_add_detached_signatures(networkstatus_t *target,
                                           ns_detached_signatures_t *sigs,
                                           const char **msg_out);
-char *networkstatus_get_detached_signatures(networkstatus_vote_t *consensus);
+char *networkstatus_get_detached_signatures(networkstatus_t *consensus);
 void ns_detached_signatures_free(ns_detached_signatures_t *s);
 
 /* cert manipulation */
@@ -3184,14 +3182,14 @@
                                       int naming, int exits_can_be_guards,
                                       int listbadexits, int listbaddirs);
 void router_clear_status_flags(routerinfo_t *ri);
-networkstatus_vote_t *
+networkstatus_t *
 dirserv_generate_networkstatus_vote_obj(crypto_pk_env_t *private_key,
                                         authority_cert_t *cert);
 
 #ifdef DIRVOTE_PRIVATE
 char *
 format_networkstatus_vote(crypto_pk_env_t *private_key,
-                          networkstatus_vote_t *v3_ns);
+                          networkstatus_t *v3_ns);
 #endif
 
 /********************************* dns.c ***************************/
@@ -3324,13 +3322,13 @@
 int router_reload_consensus_networkstatus(void);
 void routerstatus_free(routerstatus_t *rs);
 void networkstatus_v2_free(networkstatus_v2_t *ns);
-void networkstatus_vote_free(networkstatus_vote_t *ns);
+void networkstatus_vote_free(networkstatus_t *ns);
 networkstatus_voter_info_t *networkstatus_get_voter_by_id(
-                                       networkstatus_vote_t *vote,
+                                       networkstatus_t *vote,
                                        const char *identity);
-int networkstatus_check_consensus_signature(networkstatus_vote_t *consensus,
+int networkstatus_check_consensus_signature(networkstatus_t *consensus,
                                             int warn);
-int networkstatus_check_voter_signature(networkstatus_vote_t *consensus,
+int networkstatus_check_voter_signature(networkstatus_t *consensus,
                                         networkstatus_voter_info_t *voter,
                                         authority_cert_t *cert);
 char *networkstatus_get_cache_filename(const char *identity_digest);
@@ -3340,9 +3338,9 @@
 void networkstatus_v2_list_clean(time_t now);
 routerstatus_t *networkstatus_v2_find_entry(networkstatus_v2_t *ns,
                                          const char *digest);
-routerstatus_t *networkstatus_vote_find_entry(networkstatus_vote_t *ns,
+routerstatus_t *networkstatus_vote_find_entry(networkstatus_t *ns,
                                               const char *digest);
-int networkstatus_vote_find_entry_idx(networkstatus_vote_t *ns,
+int networkstatus_vote_find_entry_idx(networkstatus_t *ns,
                                       const char *digest, int *found_out);
 const smartlist_t *networkstatus_get_v2_list(void);
 download_status_t *router_get_dl_status_by_descriptor_digest(const char *d);
@@ -3359,9 +3357,9 @@
 void update_networkstatus_downloads(time_t now);
 void update_certificate_downloads(time_t now);
 networkstatus_v2_t *networkstatus_v2_get_by_digest(const char *digest);
-networkstatus_vote_t *networkstatus_get_latest_consensus(void);
-networkstatus_vote_t *networkstatus_get_live_consensus(time_t now);
-networkstatus_vote_t *networkstatus_get_reasonably_live_consensus(time_t now);
+networkstatus_t *networkstatus_get_latest_consensus(void);
+networkstatus_t *networkstatus_get_live_consensus(time_t now);
+networkstatus_t *networkstatus_get_reasonably_live_consensus(time_t now);
 #define NSSET_FROM_CACHE 1
 #define NSSET_WAS_WAITING_FOR_CERTS 2
 #define NSSET_DONT_DOWNLOAD_CERTS 4
@@ -3844,7 +3842,7 @@
                                                 const char *sk_digest);
 void authority_cert_get_all(smartlist_t *certs_out);
 void authority_cert_dl_failed(const char *id_digest, int status);
-void authority_certs_fetch_missing(networkstatus_vote_t *status, time_t now);
+void authority_certs_fetch_missing(networkstatus_t *status, time_t now);
 int router_reload_router_list(void);
 smartlist_t *router_get_trusted_dir_servers(void);
 
@@ -4016,7 +4014,7 @@
 void dump_distinct_digest_count(int severity);
 
 networkstatus_v2_t *networkstatus_v2_parse_from_string(const char *s);
-networkstatus_vote_t *networkstatus_parse_vote_from_string(const char *s,
+networkstatus_t *networkstatus_parse_vote_from_string(const char *s,
                                                           const char **eos_out,
                                                           int is_vote);
 ns_detached_signatures_t *networkstatus_parse_detached_signatures(

Modified: tor/trunk/src/or/rendservice.c
===================================================================
--- tor/trunk/src/or/rendservice.c	2008-02-05 19:40:26 UTC (rev 13382)
+++ tor/trunk/src/or/rendservice.c	2008-02-05 21:39:29 UTC (rev 13383)
@@ -1123,7 +1123,7 @@
   /* Upload v2 descriptor? */
   if (service->descriptor_version == 2 &&
       get_options()->PublishHidServDescriptors) {
-    networkstatus_vote_t *c = networkstatus_get_latest_consensus();
+    networkstatus_t *c = networkstatus_get_latest_consensus();
     if (c && smartlist_len(c->routerstatus_list) > 0) {
       int seconds_valid;
       smartlist_t *descs = smartlist_create();

Modified: tor/trunk/src/or/routerlist.c
===================================================================
--- tor/trunk/src/or/routerlist.c	2008-02-05 19:40:26 UTC (rev 13382)
+++ tor/trunk/src/or/routerlist.c	2008-02-05 21:39:29 UTC (rev 13383)
@@ -366,7 +366,7 @@
  * already have.
  **/
 void
-authority_certs_fetch_missing(networkstatus_vote_t *status, time_t now)
+authority_certs_fetch_missing(networkstatus_t *status, time_t now)
 {
   digestmap_t *pending;
   smartlist_t *missing_digests;
@@ -924,7 +924,7 @@
   smartlist_t *trusted_direct, *trusted_tunnel;
   smartlist_t *overloaded_direct, *overloaded_tunnel;
   time_t now = time(NULL);
-  const networkstatus_vote_t *consensus = networkstatus_get_latest_consensus();
+  const networkstatus_t *consensus = networkstatus_get_latest_consensus();
   int requireother = ! (flags & PDS_ALLOW_SELF);
   int fascistfirewall = ! (flags & PDS_IGNORE_FASCISTFIREWALL);
   int prefer_tunnel = (flags & _PDS_PREFER_TUNNELED_DIR_CONNS);
@@ -2695,7 +2695,7 @@
   int authdir = authdir_mode_handles_descs(get_options(), router->purpose);
   int authdir_believes_valid = 0;
   routerinfo_t *old_router;
-  networkstatus_vote_t *consensus = networkstatus_get_latest_consensus();
+  networkstatus_t *consensus = networkstatus_get_latest_consensus();
   const smartlist_t *networkstatus_v2_list = networkstatus_get_v2_list();
   int in_consensus = 0;
 
@@ -2992,7 +2992,7 @@
   signed_descriptor_t *sd;
   digestmap_t *retain;
   int caches = directory_caches_dir_info(get_options());
-  const networkstatus_vote_t *consensus = networkstatus_get_latest_consensus();
+  const networkstatus_t *consensus = networkstatus_get_latest_consensus();
   const smartlist_t *networkstatus_v2_list = networkstatus_get_v2_list();
 
   trusted_dirs_remove_old_certs();
@@ -3308,7 +3308,7 @@
 signed_desc_digest_is_recognized(signed_descriptor_t *desc)
 {
   routerstatus_t *rs;
-  networkstatus_vote_t *consensus = networkstatus_get_latest_consensus();
+  networkstatus_t *consensus = networkstatus_get_latest_consensus();
   int caches = directory_caches_dir_info(get_options());
   const smartlist_t *networkstatus_v2_list = networkstatus_get_v2_list();
 
@@ -3848,7 +3848,7 @@
   smartlist_t *no_longer_old = smartlist_create();
   smartlist_t *downloadable = smartlist_create();
   int authdir = authdir_mode(options);
-  networkstatus_vote_t *consensus =
+  networkstatus_t *consensus =
     networkstatus_get_reasonably_live_consensus(now);
   int n_delayed=0, n_have=0, n_would_reject=0, n_wouldnt_use=0,
     n_inprogress=0, n_in_oldrouters=0;
@@ -4075,7 +4075,7 @@
   time_t now = time(NULL);
   int res;
   or_options_t *options = get_options();
-  const networkstatus_vote_t *consensus =
+  const networkstatus_t *consensus =
     networkstatus_get_reasonably_live_consensus(now);
 
   if (!consensus) {
@@ -4487,7 +4487,7 @@
                                      const char *id)
 {
   int start, found, n_added = 0, i;
-  networkstatus_vote_t *c = networkstatus_get_latest_consensus();
+  networkstatus_t *c = networkstatus_get_latest_consensus();
   if (!c || !smartlist_len(c->routerstatus_list)) {
     log_warn(LD_REND, "We don't have a consensus, so we can't perform v2 "
              "rendezvous operations.");
@@ -4519,7 +4519,7 @@
 hid_serv_acting_as_directory(void)
 {
   routerinfo_t *me = router_get_my_routerinfo();
-  networkstatus_vote_t *c;
+  networkstatus_t *c;
   routerstatus_t *rs;
   if (!me)
     return 0;

Modified: tor/trunk/src/or/routerparse.c
===================================================================
--- tor/trunk/src/or/routerparse.c	2008-02-05 19:40:26 UTC (rev 13382)
+++ tor/trunk/src/or/routerparse.c	2008-02-05 21:39:29 UTC (rev 13383)
@@ -341,7 +341,7 @@
   END_OF_TABLE
 };
 
-static token_rule_t networkstatus_vote_token_table[] = {
+static token_rule_t networkstatus_token_table[] = {
   T1("network-status-version", K_NETWORK_STATUS_VERSION,
                                                    GE(1),       NO_OBJ ),
   T1("vote-status",            K_VOTE_STATUS,      GE(1),       NO_OBJ ),
@@ -1605,7 +1605,7 @@
  **/
 static routerstatus_t *
 routerstatus_parse_entry_from_string(const char **s, smartlist_t *tokens,
-                                     networkstatus_vote_t *vote,
+                                     networkstatus_t *vote,
                                      vote_routerstatus_t *vote_rs,
                                      int consensus_method)
 {
@@ -1950,14 +1950,14 @@
 /** Parse a v3 networkstatus vote (if <b>is_vote</b> is true) or a v3
  * networkstatus consensus (if <b>is_vote</b> is false) from <b>s</b>, and
  * return the result.  Return NULL on failure. */
-networkstatus_vote_t *
+networkstatus_t *
 networkstatus_parse_vote_from_string(const char *s, const char **eos_out,
                                      int is_vote)
 {
   smartlist_t *tokens = smartlist_create();
   smartlist_t *rs_tokens = NULL, *footer_tokens = NULL;
   networkstatus_voter_info_t *voter = NULL;
-  networkstatus_vote_t *ns = NULL;
+  networkstatus_t *ns = NULL;
   char ns_digest[DIGEST_LEN];
   const char *cert, *end_of_header, *end_of_footer;
   directory_token_t *tok;
@@ -1972,13 +1972,13 @@
 
   end_of_header = find_start_of_next_routerstatus(s);
   if (tokenize_string(s, end_of_header, tokens,
-                      is_vote ? networkstatus_vote_token_table :
+                      is_vote ? networkstatus_token_table :
                                 networkstatus_consensus_token_table, 0)) {
     log_warn(LD_DIR, "Error tokenizing network-status vote header.");
     goto err;
   }
 
-  ns = tor_malloc_zero(sizeof(networkstatus_vote_t));
+  ns = tor_malloc_zero(sizeof(networkstatus_t));
   memcpy(ns->networkstatus_digest, ns_digest, DIGEST_LEN);
 
   if (is_vote) {

Modified: tor/trunk/src/or/test.c
===================================================================
--- tor/trunk/src/or/test.c	2008-02-05 19:40:26 UTC (rev 13382)
+++ tor/trunk/src/or/test.c	2008-02-05 21:39:29 UTC (rev 13383)
@@ -2513,7 +2513,7 @@
 
   time_t now = time(NULL);
   networkstatus_voter_info_t *voter;
-  networkstatus_vote_t *vote, *v1, *v2, *v3, *con;
+  networkstatus_t *vote, *v1, *v2, *v3, *con;
   vote_routerstatus_t *vrs;
   routerstatus_t *rs;
   char *v1_text, *v2_text, *v3_text, *consensus_text, *cp;
@@ -2543,7 +2543,7 @@
   /*
    * Set up a vote; generate it; try to parse it.
    */
-  vote = tor_malloc_zero(sizeof(networkstatus_vote_t));
+  vote = tor_malloc_zero(sizeof(networkstatus_t));
   vote->is_vote = 1;
   vote->published = now;
   vote->valid_after = now+1000;
@@ -2840,7 +2840,7 @@
 
   {
     char *consensus_text2, *consensus_text3;
-    networkstatus_vote_t *con2, *con3;
+    networkstatus_t *con2, *con3;
     char *detached_text1, *detached_text2;
     ns_detached_signatures_t *dsig1, *dsig2;
     const char *msg=NULL;



More information about the tor-commits mailing list