2019-10-29 05:00:55 +01:00
|
|
|
/* 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 relay_config.h
|
|
|
|
* @brief Header for feature/relay/relay_config.c
|
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef TOR_FEATURE_RELAY_RELAY_CONFIG_H
|
|
|
|
#define TOR_FEATURE_RELAY_RELAY_CONFIG_H
|
|
|
|
|
2019-10-29 07:22:39 +01:00
|
|
|
#include "lib/cc/torint.h"
|
|
|
|
#include "lib/testsupport/testsupport.h"
|
|
|
|
|
2019-10-29 05:00:55 +01:00
|
|
|
typedef struct or_options_t or_options_t;
|
|
|
|
typedef struct smartlist_t smartlist_t;
|
|
|
|
|
2019-10-30 06:30:11 +01:00
|
|
|
MOCK_DECL(const char*, get_dirportfrontpage, (void));
|
|
|
|
void relay_config_free_all(void);
|
|
|
|
|
|
|
|
uint32_t get_effective_bwrate(const or_options_t *options);
|
|
|
|
uint32_t get_effective_bwburst(const or_options_t *options);
|
|
|
|
|
2019-10-29 05:00:55 +01:00
|
|
|
int parse_ports_relay(or_options_t *options,
|
|
|
|
char **msg,
|
|
|
|
smartlist_t *ports_out,
|
|
|
|
int *have_low_ports_out);
|
|
|
|
void update_port_set_relay(or_options_t *options,
|
|
|
|
const smartlist_t *ports);
|
|
|
|
|
2019-10-29 07:22:39 +01:00
|
|
|
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);
|
2019-10-29 08:54:18 +01:00
|
|
|
|
|
|
|
int options_validate_relay_accounting(const or_options_t *old_options,
|
|
|
|
or_options_t *options,
|
|
|
|
char **msg);
|
2019-10-29 07:22:39 +01:00
|
|
|
|
|
|
|
int options_validate_relay_mode(const or_options_t *old_options,
|
|
|
|
or_options_t *options,
|
|
|
|
char **msg);
|
|
|
|
|
2019-10-29 08:54:18 +01:00
|
|
|
int options_validate_relay_testing(const or_options_t *old_options,
|
|
|
|
or_options_t *options,
|
|
|
|
char **msg);
|
|
|
|
|
2019-10-30 06:30:11 +01:00
|
|
|
int options_act_relay(const or_options_t *old_options);
|
|
|
|
int options_act_relay_accounting(const or_options_t *old_options);
|
|
|
|
int options_act_relay_bandwidth(const or_options_t *old_options);
|
|
|
|
int options_act_bridge_stats(const or_options_t *old_options);
|
|
|
|
int options_act_relay_stats(const or_options_t *old_options,
|
|
|
|
bool *print_notice_out);
|
|
|
|
void options_act_relay_stats_msg(void);
|
|
|
|
|
|
|
|
int options_act_relay_desc(const or_options_t *old_options);
|
|
|
|
int options_act_relay_dos(const or_options_t *old_options);
|
|
|
|
int options_act_relay_dir(const or_options_t *old_options);
|
|
|
|
|
2019-10-29 07:22:39 +01:00
|
|
|
#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
|
|
|
|
|
2019-10-29 05:00:55 +01:00
|
|
|
#endif /* !defined(TOR_FEATURE_RELAY_RELAY_CONFIG_H) */
|