[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] r11483: Add getinfo status/good-server-descriptor and status/reachab (in tor/trunk: . doc/spec src/or)
Author: nickm
Date: 2007-09-18 11:53:55 -0400 (Tue, 18 Sep 2007)
New Revision: 11483
Modified:
tor/trunk/
tor/trunk/ChangeLog
tor/trunk/doc/spec/control-spec.txt
tor/trunk/src/or/control.c
Log:
r15143@catbus: nickm | 2007-09-18 11:49:46 -0400
Add getinfo status/good-server-descriptor and status/reachability-succeeded. Patch from Robert Hogan.
Property changes on: tor/trunk
___________________________________________________________________
svk:merge ticket from /tor/trunk [r15143] on 8246c3cf-6607-4228-993b-4d95d33730f1
Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog 2007-09-18 15:53:53 UTC (rev 11482)
+++ tor/trunk/ChangeLog 2007-09-18 15:53:55 UTC (rev 11483)
@@ -14,6 +14,9 @@
o Minor features (controller):
- Accept LF instead of CRLF on controller, since some software has a
hard time generating real Internet newlines.
+ - Add GETINFO values for the server status events
+ "REACHABILITY_SUCCEEDED" and "GOOD_SERVER_DESCRIPTOR". Patch from
+ Robert Hogan.
o Removed features:
- Routers no longer include bandwidth-history lines in their
Modified: tor/trunk/doc/spec/control-spec.txt
===================================================================
--- tor/trunk/doc/spec/control-spec.txt 2007-09-18 15:53:53 UTC (rev 11482)
+++ tor/trunk/doc/spec/control-spec.txt 2007-09-18 15:53:55 UTC (rev 11483)
@@ -524,11 +524,21 @@
"status/circuit-established"
"status/enough-dir-info"
+ "status/good-server-descriptor"
"status/..."
These provide the current internal Tor values for various Tor
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.)
+ you want more exposed.)<
+ "status/reachability/or"
+ 0 or 1, depending on whether we've found our ORPort reachable.
+ "status/reachability/dir"
+ 0 or 1, depending on whether we've found our DirPort reachable.
+ "status/reachability"
+ "OR=" ("0"/"1") SP "DIR=" ("0"/"1")
+ Combines status/reachability/*; controllers MUST ignore unrecognized
+ elements in this entry.
+
"status/version/recommended" -- List of currently recommended versions
"status/version/current" -- Status of the current version. One of:
new, old, unrecommended, recommended, new in series, obsolete.
@@ -1322,7 +1332,8 @@
"ORADDRESS=IP:port"
"DIRADDRESS=IP:port"
We successfully verified the reachability of our external OR port or
- directory port.
+ directory port (depending on which of ORADDRESS or DIRADDRESS is
+ given.)
{This event could effect the controller's idea of server status, but
the controller should not interrupt the user to tell them so.}
Modified: tor/trunk/src/or/control.c
===================================================================
--- tor/trunk/src/or/control.c 2007-09-18 15:53:53 UTC (rev 11482)
+++ tor/trunk/src/or/control.c 2007-09-18 15:53:55 UTC (rev 11483)
@@ -1589,6 +1589,18 @@
*answer = tor_strdup(has_completed_circuit ? "1" : "0");
} else if (!strcmp(question, "status/enough-dir-info")) {
*answer = tor_strdup(router_have_minimum_dir_info() ? "1" : "0");
+ } else if (!strcmp(question, "status/good-server-descriptor")) {
+ *answer = tor_strdup(directories_have_accepted_server_descriptor()
+ ? "1" : "0");
+ } else if (!strcmp(question, "status/reachability-succeeded/or")) {
+ *answer = tor_strdup(check_whether_orport_reachable() ? "1" : "0");
+ } else if (!strcmp(question, "status/reachability-succeeded/dir")) {
+ *answer = tor_strdup(check_whether_dirport_reachable() ? "1" : "0");
+ } else if (!strcmp(question, "status/reachability-succeeded")) {
+ *answer = tor_malloc(16);
+ tor_snprintf(*answer, 16, "OR=%d DIR=%d",
+ check_whether_orport_reachable() ? 1 : 0,
+ check_whether_dirport_reachable() ? 1 : 0);
} else if (!strcmpstart(question, "status/version/")) {
combined_version_status_t st;
int is_server = server_mode(get_options());