summaryrefslogtreecommitdiff
path: root/src/feature/relay/relay_config.h
diff options
context:
space:
mode:
authorteor <teor@torproject.org>2019-10-29 16:22:39 +1000
committerteor <teor@torproject.org>2019-10-31 12:34:19 +1000
commit093a127c82a06546029e42cf0030edf43fb5f87b (patch)
treede1922bd59703549b56f51aa37d7587ecf0c0447 /src/feature/relay/relay_config.h
parent0722b4fdb92337c58a96ed3538d922f394572ee0 (diff)
downloadtor-093a127c82a06546029e42cf0030edf43fb5f87b.tar.gz
tor-093a127c82a06546029e42cf0030edf43fb5f87b.zip
config: Move relay config checks into the relay module
This commit: * moves relay config checks into relay_config.[ch], * exposes some code from src/app/config.c (we'll refactor it later in 29211), and * adds thin wrappers to make the moved code compile. No functional changes: the moved code is still enabled, even if the relay module is disabled. (Some of the checks are re-ordered, so the order of some warnings may change.) Part of 32213.
Diffstat (limited to 'src/feature/relay/relay_config.h')
-rw-r--r--src/feature/relay/relay_config.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/feature/relay/relay_config.h b/src/feature/relay/relay_config.h
index 1b46e825ad..93fcd4acb3 100644
--- a/src/feature/relay/relay_config.h
+++ b/src/feature/relay/relay_config.h
@@ -12,6 +12,9 @@
#ifndef TOR_FEATURE_RELAY_RELAY_CONFIG_H
#define TOR_FEATURE_RELAY_RELAY_CONFIG_H
+#include "lib/cc/torint.h"
+#include "lib/testsupport/testsupport.h"
+
typedef struct or_options_t or_options_t;
typedef struct smartlist_t smartlist_t;
@@ -22,4 +25,36 @@ int parse_ports_relay(or_options_t *options,
void update_port_set_relay(or_options_t *options,
const smartlist_t *ports);
+int options_validate_relay_os(const or_options_t *old_options,
+ or_options_t *options,
+ char **msg);
+
+int options_validate_relay_info(const or_options_t *old_options,
+ or_options_t *options,
+ char **msg);
+
+int options_validate_publish_server(const or_options_t *old_options,
+ or_options_t *options,
+ char **msg);
+
+int options_validate_relay_padding(const or_options_t *old_options,
+ or_options_t *options,
+ char **msg);
+
+int options_validate_relay_bandwidth(const or_options_t *old_options,
+ or_options_t *options,
+ char **msg);
+
+int options_validate_relay_mode(const or_options_t *old_options,
+ or_options_t *options,
+ char **msg);
+
+#ifdef RELAY_CONFIG_PRIVATE
+
+STATIC int check_bridge_distribution_setting(const char *bd);
+STATIC int have_enough_mem_for_dircache(const or_options_t *options,
+ size_t total_mem, char **msg);
+
+#endif
+
#endif /* !defined(TOR_FEATURE_RELAY_RELAY_CONFIG_H) */