aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/control-spec.txt7
-rw-r--r--src/or/control.c4
-rw-r--r--src/or/or.h1
-rw-r--r--src/or/policies.c12
4 files changed, 24 insertions, 0 deletions
diff --git a/doc/control-spec.txt b/doc/control-spec.txt
index 196cf7e7a..b8566d603 100644
--- a/doc/control-spec.txt
+++ b/doc/control-spec.txt
@@ -316,6 +316,13 @@ $Id$
"config-file" -- The location of Tor's configuration file ("torrc").
+ ["exit-policy/prepend" -- The default exit policy lines that Tor will
+ *prepend* to the ExitPolicy config option.
+ -- Never implemented. Useful?]
+
+ "exit-policy/default" -- The default exit policy lines that Tor will
+ *append* to the ExitPolicy config option.
+
"desc/id/<OR identity>" or "desc/name/<OR nickname>" -- the latest
server descriptor for a given OR, NUL-terminated.
diff --git a/src/or/control.c b/src/or/control.c
index abe1759ae..7e06ec3ef 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -1289,12 +1289,14 @@ list_getinfo_options(void)
"addr-mappings/configl Addresses remapped from configuration options.\n"
"addr-mappings/control Addresses remapped by a controller.\n"
"circuit-status Status of each current circuit.\n"
+ "config-file Current location of the \"torrc\" file.\n"
"config/names List of configuration options, types, and documentation.\n"
"desc/id/* Server descriptor by hex ID\n"
"desc/name/* Server descriptor by nickname.\n"
"desc/all-recent Latest server descriptor for every router\n"
"dir/server/* Fetch server descriptors -- see dir-spec.txt\n"
"entry-guards Which nodes will we use as entry guards?\n"
+ "exit-policy/default Default lines appended to config->ExitPolicy\n"
"info/names List of GETINFO options, types, and documentation.\n"
"network-status List of hex IDs, nicknames, server statuses.\n"
"orconn-status Status of each current OR connection.\n"
@@ -1532,6 +1534,8 @@ handle_getinfo_helper(const char *question, char **answer)
cp += d->dir_len;
});
*cp = '\0';
+ } else if (!strcmpstart(question, "exit-policy/")) {
+ return policies_getinfo_helper(question, answer);
}
return 0;
}
diff --git a/src/or/or.h b/src/or/or.h
index 92a7e5f2b..99acf2b41 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -2051,6 +2051,7 @@ int policies_parse_exit_policy(config_line_t *cfg,
addr_policy_t **dest,
int rejectprivate);
int exit_policy_is_general_exit(addr_policy_t *policy);
+int policies_getinfo_helper(const char *question, char **answer);
void addr_policy_free(addr_policy_t *p);
void policies_free_all(void);
diff --git a/src/or/policies.c b/src/or/policies.c
index 7eff70fc9..31622a012 100644
--- a/src/or/policies.c
+++ b/src/or/policies.c
@@ -627,6 +627,18 @@ exit_policy_is_general_exit(addr_policy_t *policy)
return n_allowed >= 2;
}
+int
+policies_getinfo_helper(const char *question, char **answer)
+{
+ if (!strcmp(question, "exit-policy/default")) {
+ *answer = tor_strdup(DEFAULT_EXIT_POLICY);
+// } else if (!strcmp(question, "exit-policy/prepend")) {
+ } else {
+ *answer = NULL;
+ }
+ return 0;
+}
+
/** Release all storage held by <b>p</b> */
void
addr_policy_free(addr_policy_t *p)