12 #ifndef TOR_FEATURE_RELAY_RELAY_CONFIG_H
13 #define TOR_FEATURE_RELAY_RELAY_CONFIG_H
17 #ifdef HAVE_MODULE_RELAY
35 const char *portname);
40 int *have_low_ports_out);
78 bool *print_notice_out);
85 #ifdef RELAY_CONFIG_PRIVATE
90 size_t total_mem,
char **msg);
126 *msg = tor_strdup(
"This tor was built with relay mode disabled. "
127 "It can not be configured with an ORPort, a DirPort, "
128 "DirCache 1, or BridgeRelay 1.");
139 int *have_low_ports_out)
144 if (*have_low_ports_out < 0)
145 *have_low_ports_out = 0;
149 #define relay_get_dirportfrontpage() \
151 #define relay_config_free_all() \
154 #define relay_get_effective_bwrate(options) \
155 (((void)(options)),0)
156 #define relay_get_effective_bwburst(options) \
157 (((void)(options)),0)
159 #define port_warn_nonlocal_ext_orports(ports, portname) \
160 (((void)(ports)),((void)(portname)))
162 #define port_update_port_set_relay(options, ports) \
163 (((void)(options)),((void)(ports)))
165 #define options_validate_relay_os(old_options, options, msg) \
166 (((void)(old_options)),((void)(options)),((void)(msg)),0)
167 #define options_validate_relay_info(old_options, options, msg) \
168 (((void)(old_options)),((void)(options)),((void)(msg)),0)
169 #define options_validate_publish_server(old_options, options, msg) \
170 (((void)(old_options)),((void)(options)),((void)(msg)),0)
171 #define options_validate_relay_padding(old_options, options, msg) \
172 (((void)(old_options)),((void)(options)),((void)(msg)),0)
173 #define options_validate_relay_bandwidth(old_options, options, msg) \
174 (((void)(old_options)),((void)(options)),((void)(msg)),0)
175 #define options_validate_relay_accounting(old_options, options, msg) \
176 (((void)(old_options)),((void)(options)),((void)(msg)),0)
177 #define options_validate_relay_testing(old_options, options, msg) \
178 (((void)(old_options)),((void)(options)),((void)(msg)),0)
180 #define options_act_relay(old_options) \
181 (((void)(old_options)),0)
182 #define options_act_relay_accounting(old_options) \
183 (((void)(old_options)),0)
184 #define options_act_relay_bandwidth(old_options) \
185 (((void)(old_options)),0)
186 #define options_act_bridge_stats(old_options) \
187 (((void)(old_options)),0)
189 #define options_act_relay_stats(old_options, print_notice_out) \
190 (((void)(old_options)),((void)(print_notice_out)),0)
191 #define options_act_relay_stats_msg() \
194 #define options_act_relay_desc(old_options) \
195 (((void)(old_options)),0)
196 #define options_act_relay_dos(old_options) \
197 (((void)(old_options)),0)
198 #define options_act_relay_dir(old_options) \
199 (((void)(old_options)),0)
Utility macros to handle different features and behavior in different compilers.
STATIC void remove_duplicate_orports(smartlist_t *ports)
STATIC int check_bridge_distribution_setting(const char *bd)
int options_act_relay_bandwidth(const or_options_t *old_options)
int options_validate_relay_padding(const or_options_t *old_options, or_options_t *options, char **msg)
int options_act_relay_stats(const or_options_t *old_options, bool *print_notice_out)
void port_update_port_set_relay(or_options_t *options, const smartlist_t *ports)
int options_act_relay(const or_options_t *old_options)
int options_validate_relay_accounting(const or_options_t *old_options, or_options_t *options, char **msg)
const char * relay_get_dirportfrontpage(void)
void relay_config_free_all(void)
int options_validate_relay_bandwidth(const or_options_t *old_options, or_options_t *options, char **msg)
int options_validate_relay_os(const or_options_t *old_options, or_options_t *options, char **msg)
int options_act_relay_dir(const or_options_t *old_options)
void port_warn_nonlocal_ext_orports(const smartlist_t *ports, const char *portname)
int port_parse_ports_relay(or_options_t *options, char **msg, smartlist_t *ports_out, int *have_low_ports_out)
int options_act_relay_accounting(const or_options_t *old_options)
void options_act_relay_stats_msg(void)
uint32_t relay_get_effective_bwrate(const or_options_t *options)
uint32_t relay_get_effective_bwburst(const or_options_t *options)
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_act_relay_dos(const or_options_t *old_options)
STATIC const char * describe_relay_port(const port_cfg_t *port)
int options_act_relay_desc(const or_options_t *old_options)
int options_act_bridge_stats(const or_options_t *old_options)
int options_validate_relay_testing(const or_options_t *old_options, or_options_t *options, char **msg)
STATIC int have_enough_mem_for_dircache(const or_options_t *options, size_t total_mem, char **msg)
static int options_validate_relay_mode(const struct or_options_t *old_options, struct or_options_t *options, char **msg)
struct config_line_t * ORPort_lines
struct config_line_t * DirPort_lines
Macros to implement mocking and selective exposure for the test code.
#define MOCK_DECL(rv, funcname, arglist)
Integer definitions used throughout Tor.