[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] [tor/master] ConsensusParams config option lists key=value params



Author: Roger Dingledine <arma@xxxxxxxxxxxxxx>
Date: Tue, 15 Sep 2009 04:40:08 -0400
Subject: ConsensusParams config option lists key=value params
Commit: 40bcab1faf26dd26de48b5ea6c1846c562a11f9d

finishes the authority-operator interface side of proposal 167.
---
 doc/tor.1.in     |    7 ++++++-
 src/or/config.c  |    1 +
 src/or/dirserv.c |    7 +++++++
 src/or/or.h      |    4 ++++
 4 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/doc/tor.1.in b/doc/tor.1.in
index a0f8e8b..a5f6fe0 100644
--- a/doc/tor.1.in
+++ b/doc/tor.1.in
@@ -1,4 +1,4 @@
-.TH TOR 1 "August 2009" "TOR"
+.TH TOR 1 "September 2009" "TOR"
 .SH NAME
 tor \- The second-generation onion router
 .SH SYNOPSIS
@@ -1243,6 +1243,11 @@ When this is set then
 \fBVersioningAuthoritativeDirectory\fP should be set too.
 .LP
 .TP
+\fBConsensusParams \fR\fISTRING\fP
+STRING is a space-separated list of key=value pairs that Tor will
+include in the "params" line of its networkstatus vote.
+.LP
+.TP
 \fBDirAllowPrivateAddresses \fR\fB0\fR|\fB1\fR\fP
 If set to 1, Tor will accept router descriptors with arbitrary "Address"
 elements. Otherwise, if the address is not an IP address or is a private
diff --git a/src/or/config.c b/src/or/config.c
index 0ec3990..d830229 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -168,6 +168,7 @@ static config_var_t _option_vars[] = {
   V(CircuitIdleTimeout,          INTERVAL, "1 hour"),
   V(ClientDNSRejectInternalAddresses, BOOL,"1"),
   V(ClientOnly,                  BOOL,     "0"),
+  V(ConsensusParams,             STRING,   NULL),
   V(ConnLimit,                   UINT,     "1000"),
   V(ConstrainedSockets,          BOOL,     "0"),
   V(ConstrainedSockSize,         MEMUNIT,  "8192"),
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index c4a3397..6a88286 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -2553,6 +2553,13 @@ dirserv_generate_networkstatus_vote_obj(crypto_pk_env_t *private_key,
   }
   smartlist_sort_strings(v3_out->known_flags);
 
+  if (options->ConsensusParams) {
+    v3_out->net_params = smartlist_create();
+    smartlist_split_string(v3_out->net_params,
+                           options->ConsensusParams, NULL, 0, 0);
+    smartlist_sort_strings(v3_out->net_params);
+  }
+
   voter = tor_malloc_zero(sizeof(networkstatus_voter_info_t));
   voter->nickname = tor_strdup(options->Nickname);
   memcpy(voter->identity_digest, identity_digest, DIGEST_LEN);
diff --git a/src/or/or.h b/src/or/or.h
index dd94027..c93b8ed 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -2587,6 +2587,10 @@ typedef struct {
   /** Location of bandwidth measurement file */
   char *V3BandwidthsFile;
 
+  /** Authority only: key=value pairs that we add to our networkstatus
+   * consensus vote on the 'params' line. */
+  char *ConsensusParams;
+
   /** The length of time that we think an initial consensus should be fresh.
    * Only altered on testing networks. */
   int TestingV3AuthInitialVotingInterval;
-- 
1.5.6.5