summaryrefslogtreecommitdiff
path: root/src/feature/hs/hs_options.inc
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2020-01-21 10:23:27 -0500
committerDavid Goulet <dgoulet@torproject.org>2020-03-30 13:31:44 -0400
commitcfaf1bca989f1841acb5360a482e4e5da3ede7dd (patch)
tree6e92f9e01736250339c20fb401ca9d72dd4941dc /src/feature/hs/hs_options.inc
parent43b578e099caac25544abdbfa4bd2c24539a8b8d (diff)
downloadtor-cfaf1bca989f1841acb5360a482e4e5da3ede7dd.tar.gz
tor-cfaf1bca989f1841acb5360a482e4e5da3ede7dd.zip
Start using confmgt logic to parse HS configuration.
This patch doesn't actually use the results of the parsed object to create the service configuration: subsequent patches will do that. This patch just introduces the necessary configuration tables and starts using them to validate the configuration. As of this writing, this patch breaks tests. I'll likely fix that in a rebase later on: the current error messages for failures to parse options are a regression, so I've opened #33640 for that.
Diffstat (limited to 'src/feature/hs/hs_options.inc')
-rw-r--r--src/feature/hs/hs_options.inc35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/feature/hs/hs_options.inc b/src/feature/hs/hs_options.inc
new file mode 100644
index 0000000000..c3566f4461
--- /dev/null
+++ b/src/feature/hs/hs_options.inc
@@ -0,0 +1,35 @@
+/* Copyright (c) 2001 Matej Pfajfar.
+ * Copyright (c) 2001-2004, Roger Dingledine.
+ * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
+ * Copyright (c) 2007-2019, The Tor Project, Inc. */
+/* See LICENSE for licensing information */
+
+/**
+ * @file dirauth_options.inc
+ * @brief Declare configuration options for a single hidden service.
+ *
+ * Note that this options file behaves differently from most, since it
+ * is not used directly by the options manager. Instead, it is applied to
+ * a group of hidden service options starting with a HiddenServiceDir and
+ * extending up to the next HiddenServiceDir.
+ **/
+
+/** Holds configuration for a single hidden service. */
+BEGIN_CONF_STRUCT(hs_opts_t)
+
+CONF_VAR(HiddenServiceDir, FILENAME, 0, NULL)
+CONF_VAR(HiddenServiceDirGroupReadable, BOOL, 0, "0")
+CONF_VAR(HiddenServicePort, STRING, 0, NULL)
+CONF_VAR(HiddenServiceVersion, POSINT, 0, "3")
+CONF_VAR(HiddenServiceAuthorizeClient, STRING, 0, NULL)
+CONF_VAR(HiddenServiceAllowUnknownPorts, BOOL, 0, "0")
+CONF_VAR(HiddenServiceMaxStreams, POSINT, 0, "0")
+CONF_VAR(HiddenServiceMaxStreamsCloseCircuit, BOOL, 0, "0")
+CONF_VAR(HiddenServiceNumIntroductionPoints, POSINT, 0, "3")
+CONF_VAR(HiddenServiceExportCircuitID, STRING, 0, NULL)
+CONF_VAR(HiddenServiceEnableIntroDoSDefense, BOOL, 0, "0")
+CONF_VAR(HiddenServiceEnableIntroDoSRatePerSec, POSINT, 0, "25")
+CONF_VAR(HiddenServiceEnableIntroDoSBurstPerSec, POSINT, 0, "200")
+CONF_VAR(HiddenServiceOnionBalanceInstance, BOOL, 0, "0")
+
+END_CONF_STRUCT(hs_opts_t)