From f45dec169030b4047028c04fb21e9d98a3e59dac Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 18 Sep 2007 15:53:55 +0000 Subject: r15143@catbus: nickm | 2007-09-18 11:49:46 -0400 Add getinfo status/good-server-descriptor and status/reachability-succeeded. Patch from Robert Hogan. svn:r11483 --- src/or/control.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src') diff --git a/src/or/control.c b/src/or/control.c index adbfad7366..0faaa502a1 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -1589,6 +1589,18 @@ getinfo_helper_events(control_connection_t *control_conn, *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()); -- cgit v1.2.3-54-g00ecf