summaryrefslogtreecommitdiff
path: root/doc/spec/control-spec.txt
diff options
context:
space:
mode:
Diffstat (limited to 'doc/spec/control-spec.txt')
-rw-r--r--doc/spec/control-spec.txt136
1 files changed, 102 insertions, 34 deletions
diff --git a/doc/spec/control-spec.txt b/doc/spec/control-spec.txt
index cf92e2b9e3..b60baba052 100644
--- a/doc/spec/control-spec.txt
+++ b/doc/spec/control-spec.txt
@@ -1,4 +1,3 @@
-$Id$
TC: A Tor control protocol (Version 1)
@@ -88,6 +87,10 @@ $Id$
2.4. General-use tokens
+ ; CRLF means, "the ASCII Carriage Return character (decimal value value 13)
+ ; followed by the ASCII Linefeed character (decimal value 10)."
+ CRLF = CR LF
+
; Identifiers for servers.
ServerID = Nickname / Fingerprint
@@ -220,7 +223,7 @@ $Id$
"INFO" / "NOTICE" / "WARN" / "ERR" / "NEWDESC" / "ADDRMAP" /
"AUTHDIR_NEWDESCS" / "DESCCHANGED" / "STATUS_GENERAL" /
"STATUS_CLIENT" / "STATUS_SERVER" / "GUARD" / "NS" / "STREAM_BW" /
- "CLIENTS_SEEN"
+ "CLIENTS_SEEN" / "NEWCONSENSUS" / "BUILDTIMEOUT_SET"
Any events *not* listed in the SETEVENTS line are turned off; thus, sending
SETEVENTS with an empty body turns off all event reporting.
@@ -271,6 +274,9 @@ $Id$
returns "250 OK" if successful, or "551 Unable to write configuration
to disk" if it can't write the file or some other error occurs.
+ See also the "getinfo config-text" command, if the controller wants
+ to write the torrc file itself.
+
3.7. SIGNAL
Sent from the client to the server. The syntax is:
@@ -379,6 +385,10 @@ $Id$
"config-file" -- The location of Tor's configuration file ("torrc").
+ "config-text" -- The contents that Tor would write if you send it
+ a SAVECONF command, so the controller can write the file to
+ disk itself. [First implemented in 0.2.2.7-alpha.]
+
["exit-policy/prepend" -- The default exit policy lines that Tor will
*prepend* to the ExitPolicy config option.
-- Never implemented. Useful?]
@@ -503,7 +513,7 @@ $Id$
start and the rest of the interval respectively. The 'interval-start'
and 'interval-end' fields are the borders of the current interval; the
'interval-wake' field is the time within the current interval (if any)
- where we plan[ned] to start being active.
+ where we plan[ned] to start being active. The times are GMT.
"config/names"
A series of lines listing the available configuration options. Each is
@@ -564,14 +574,14 @@ $Id$
states. See Section 4.1.10 for explanations. (Only a few of the
status events are available as getinfo's currently. Let us know if
you want more exposed.)
- "status/reachability/or"
+ "status/reachability-succeeded/or"
0 or 1, depending on whether we've found our ORPort reachable.
- "status/reachability/dir"
+ "status/reachability-succeeded/dir"
0 or 1, depending on whether we've found our DirPort reachable.
- "status/reachability"
+ "status/reachability-succeeded"
"OR=" ("0"/"1") SP "DIR=" ("0"/"1")
- Combines status/reachability/*; controllers MUST ignore unrecognized
- elements in this entry.
+ Combines status/reachability-succeeded/*; controllers MUST ignore
+ unrecognized elements in this entry.
"status/bootstrap-phase"
Returns the most recent bootstrap phase status event
sent. Specifically, it returns a string starting with either
@@ -582,7 +592,7 @@ $Id$
List of currently recommended versions.
"status/version/current"
Status of the current version. One of: new, old, unrecommended,
- recommended, new in series, obsolete.
+ recommended, new in series, obsolete, unknown.
"status/clients-seen"
A summary of which countries we've seen clients from recently,
formatted the same as the CLIENTS_SEEN status event described in
@@ -600,15 +610,20 @@ $Id$
3.10. EXTENDCIRCUIT
Sent from the client to the server. The format is:
- "EXTENDCIRCUIT" SP CircuitID SP
- ServerSpec *("," ServerSpec)
- [SP "purpose=" Purpose] CRLF
+ "EXTENDCIRCUIT" SP CircuitID
+ [SP ServerSpec *("," ServerSpec)
+ SP "purpose=" Purpose] CRLF
This request takes one of two forms: either the CircuitID is zero, in
- which case it is a request for the server to build a new circuit according
- to the specified path, or the CircuitID is nonzero, in which case it is a
- request for the server to extend an existing circuit with that ID according
- to the specified path.
+ which case it is a request for the server to build a new circuit,
+ or the CircuitID is nonzero, in which case it is a request for the
+ server to extend an existing circuit with that ID according to the
+ specified path.
+
+ If the CircuitID is 0, the controller has the option of providing
+ a path for Tor to use to build the circuit. If it does not provide
+ a path, Tor will select one automatically from high capacity nodes
+ according to path-spec.txt.
If CircuitID is 0 and "purpose=" is specified, then the circuit's
purpose is set. Two choices are recognized: "general" and
@@ -775,9 +790,8 @@ $Id$
Same as passing 'EXTENDED' to SETEVENTS; this is the preferred way to
request the extended event syntax.
- This will not be always-enabled until at least two stable releases
- after 0.1.2.3-alpha, the release where it was first used for
- anything.
+ This feature was first used in 0.1.2.3-alpha. It is always-on in
+ Tor 0.2.2.1-alpha and later.
VERBOSE_NAMES
@@ -788,8 +802,9 @@ $Id$
LongName format includes a Fingerprint, an indication of Named status,
and a Nickname (if one is known).
- This will not be always-enabled until at least two stable releases
- after 0.1.2.2-alpha, the release where it was first available.
+ This will not be always-enabled until at least two stable
+ releases after 0.1.2.2-alpha, the release where it was first
+ available. It is always-on in Tor 0.2.2.1-alpha and later.
3.20. RESOLVE
@@ -1497,6 +1512,23 @@ $Id$
should just look at ACCEPTED_SERVER_DESCRIPTOR and should ignore
this event for now.}
+ SERVER_DESCRIPTOR_STATUS
+ "STATUS=" "LISTED" / "UNLISTED"
+ We just got a new networkstatus consensus, and whether we're in
+ it or not in it has changed. Specifically, status is "listed"
+ if we're listed in it but previous to this point we didn't know
+ we were listed in a consensus; and status is "unlisted" if we
+ thought we should have been listed in it (e.g. we were listed in
+ the last one), but we're not.
+
+ {Moving from listed to unlisted is not necessarily cause for
+ alarm. The relay might have failed a few reachability tests,
+ or the Internet might have had some routing problems. So this
+ feature is mainly to let relay operators know when their relay
+ has successfully been listed in the consensus.}
+
+ [Not implemented yet. We should do this in 0.2.2.x. -RD]
+
NAMESERVER_STATUS
"NS=addr"
"STATUS=" "UP" / "DOWN"
@@ -1581,17 +1613,21 @@ $Id$
4.1.13. Bandwidth used on an application stream
The syntax is:
- "650" SP "STREAM_BW" SP StreamID SP BytesRead SP BytesWritten CRLF
- BytesRead = 1*DIGIT
+ "650" SP "STREAM_BW" SP StreamID SP BytesWritten SP BytesRead CRLF
BytesWritten = 1*DIGIT
+ BytesRead = 1*DIGIT
+
+ BytesWritten and BytesRead are the number of bytes written and read
+ by the application since the last STREAM_BW event on this stream.
- BytesRead and BytesWritten are the number of bytes read and written since
- the last STREAM_BW event on this stream. These events are generated about
- once per second per stream; no events are generated for streams that have
- not read or written.
+ Note that from Tor's perspective, *reading* a byte on a stream means
+ that the application *wrote* the byte. That's why the order of "written"
+ vs "read" is opposite for stream_bw events compared to bw events.
- These events apply only to streams entering Tor (such as on a SOCKSPort,
- TransPort, or so on). They are not generated for exiting streams.
+ These events are generated about once per second per stream; no events
+ are generated for streams that have not written or read. These events
+ apply only to streams entering Tor (such as on a SOCKSPort, TransPort,
+ or so on). They are not generated for exiting streams.
4.1.14. Per-country client stats
@@ -1610,11 +1646,11 @@ $Id$
TimeStarted is a quoted string indicating when the reported summary
counts from (in GMT).
- The CountrySummary keyword has as its argument a comma-separated
- set of "countrycode=count" pairs. For example,
- 650-CLIENTS_SEEN TimeStarted="Thu Dec 25 23:50:43 EST 2008"
- 650 CountrySummary=us=16,de=8,uk=8
-[XXX Matt Edman informs me that the time format above is wrong. -RD]
+ The CountrySummary keyword has as its argument a comma-separated,
+ possibly empty set of "countrycode=count" pairs. For example (without
+ linebreak),
+ 650-CLIENTS_SEEN TimeStarted="2008-12-25 23:50:43"
+ CountrySummary=us=16,de=8,uk=8
4.1.15. New consensus networkstatus has arrived.
@@ -1629,6 +1665,38 @@ $Id$
[First added in 0.2.1.13-alpha]
+4.1.16. New circuit buildtime has been set.
+
+ The syntax is:
+ "650" SP "BUILDTIMEOUT_SET" SP Type SP "TOTAL_TIMES=" Total SP
+ "TIMEOUT_MS=" Timeout SP "XM=" Xm SP "ALPHA=" Alpha SP
+ "CUTOFF_QUANTILE=" Quantile CRLF
+ Type = "COMPUTED" / "RESET" / "SUSPENDED" / "DISCARD" / "RESUME"
+ Total = Integer count of timeouts stored
+ Timeout = Integer timeout in milliseconds
+ Xm = Estimated integer Pareto parameter Xm in milliseconds
+ Alpha = Estimated floating point Paredo paremter alpha
+ Quantile = Floating point CDF quantile cutoff point for this timeout
+
+ A new circuit build timeout time has been set. If Type is "COMPUTED",
+ Tor has computed the value based on historical data. If Type is "RESET",
+ initialization or drastic network changes have caused Tor to reset
+ the timeout back to the default, to relearn again. If Type is
+ "SUSPENDED", Tor has detected a loss of network connectivity and has
+ temporarily changed the timeout value to the default until the network
+ recovers. If type is "DISCARD", Tor has decided to discard timeout
+ values that likely happened while the network was down. If type is
+ "RESUME", Tor has decided to resume timeout calculation.
+
+ The Total value is the count of circuit build times Tor used in
+ computing this value. It is capped internally at the maximum number
+ of build times Tor stores (NCIRCUITS_TO_OBSERVE).
+
+ The Timeout itself is provided in milliseconds. Internally, Tor rounds
+ this value to the nearest second before using it.
+
+ [First added in 0.2.2.7-alpha]
+
5. Implementation notes
5.1. Authentication