13#define RELAY_CONFIG_PRIVATE
57 STMT_BEGIN *msg = tor_strdup(arg); return -1; STMT_END
58#if defined(__GNUC__) && __GNUC__ <= 3
59#define COMPLAIN(args...) \
60 STMT_BEGIN log_warn(LD_CONFIG, args); STMT_END
62#define COMPLAIN(args, ...) \
63 STMT_BEGIN log_warn(LD_CONFIG, args, ##__VA_ARGS__); STMT_END
67#define YES_IF_CHANGED_BOOL(opt) \
68 if (!CFG_EQ_BOOL(old_options, new_options, opt)) return 1;
69#define YES_IF_CHANGED_INT(opt) \
70 if (!CFG_EQ_INT(old_options, new_options, opt)) return 1;
71#define YES_IF_CHANGED_STRING(opt) \
72 if (!CFG_EQ_STRING(old_options, new_options, opt)) return 1;
73#define YES_IF_CHANGED_LINELIST(opt) \
74 if (!CFG_EQ_LINELIST(old_options, new_options, opt)) return 1;
126 if (port->is_unix_addr)
129 if (!tor_addr_is_internal(&port->addr, 1)) {
130 log_warn(
LD_CONFIG,
"You specified a public address '%s' for %sPort. "
131 "This is not advised; this address is supposed to only be "
132 "exposed on localhost so that your pluggable transport "
133 "proxies can connect to it.",
136 } SMARTLIST_FOREACH_END(port);
161 return "<null port>";
164 static char buf[256];
165 const char *type, *addr;
167 switch (port->
type) {
182 if (port->explicit_addr) {
189 type, addr, (strlen(addr) > 0) ?
":" :
"",
212 ret &= (p1->is_group_writable == p2->is_group_writable);
213 ret &= (p1->is_world_writable == p2->is_world_writable);
214 ret &= (p1->relax_dirmode_check == p2->relax_dirmode_check);
215 ret &= (p1->explicit_addr == p2->explicit_addr);
221 ret &=
tor_memeq(&p1->server_cfg, &p2->server_cfg,
255 bool *removing = tor_calloc(smartlist_len(ports),
sizeof(
bool));
257 for (
int i = 0; i < smartlist_len(ports); ++i) {
258 const port_cfg_t *current = smartlist_get(ports, i);
268 for (
int j = 0; j < smartlist_len(ports); ++j) {
269 const port_cfg_t *next = smartlist_get(ports, j);
272 if (current == next) {
301 current->explicit_addr && next->explicit_addr) {
310 if (!current->explicit_addr && next->explicit_addr) {
315 log_warn(
LD_CONFIG,
"Configuration port %s superseded by %s",
323 for (
int i = smartlist_len(ports)-1; i >= 0; --i) {
326 port_cfg_t *current = smartlist_get(ports, i);
328 port_cfg_free(current);
342 int *n_low_ports_out)
350 if (BUG(!n_low_ports_out))
353 int n_orport_advertised = 0;
354 int n_orport_advertised_ipv4 = 0;
355 int n_orport_listeners = 0;
356 int n_dirport_advertised = 0;
357 int n_dirport_listeners = 0;
358 int n_dirport_listeners_v4 = 0;
367 if (! port->server_cfg.no_advertise)
368 ++n_dirport_advertised;
369 if (! port->server_cfg.no_listen) {
370 ++n_dirport_listeners;
371 if (port_binds_ipv4(port)) {
372 ++n_dirport_listeners_v4;
376 if (! port->server_cfg.no_advertise) {
377 ++n_orport_advertised;
378 if (port_binds_ipv4(port))
379 ++n_orport_advertised_ipv4;
381 if (! port->server_cfg.no_listen)
382 ++n_orport_listeners;
387 if (!port->server_cfg.no_listen && port->port < 1024)
390 } SMARTLIST_FOREACH_END(port);
392 if (n_orport_advertised && !n_orport_listeners) {
393 log_warn(
LD_CONFIG,
"We are advertising an ORPort, but not actually "
394 "listening on one.");
397 if (n_orport_listeners && !n_orport_advertised) {
398 log_warn(
LD_CONFIG,
"We are listening on an ORPort, but not advertising "
399 "any ORPorts. This will keep us from building a %s "
400 "descriptor, and make us impossible to use.",
404 if (n_dirport_advertised && !n_dirport_listeners) {
405 log_warn(
LD_CONFIG,
"We are advertising a DirPort, but not actually "
406 "listening on one.");
409 if (n_dirport_advertised > 1) {
410 log_warn(
LD_CONFIG,
"Can't advertise more than one DirPort.");
413 if (n_orport_advertised && !n_orport_advertised_ipv4 &&
415 log_warn(
LD_CONFIG,
"Configured public relay to listen only on an IPv6 "
416 "address. Tor needs to listen on an IPv4 address too.");
419 if (n_dirport_advertised && n_dirport_listeners_v4 == 0) {
420 log_warn(
LD_CONFIG,
"We are listening on a non-IPv4 DirPort. This is not "
421 "allowed. Consider either setting an IPv4 address or "
422 "simply removing it because it is not used anymore.");
428 const char *extra =
"";
430 extra =
", and you have disabled KeepBindCapabilities.";
432 "You have set AccountingMax to use hibernation. You have also "
433 "chosen a low DirPort or OrPort%s."
434 "This combination can make Tor stop "
435 "working when it tries to re-attach the port after a period of "
436 "hibernation. Please choose a different port or turn off "
437 "hibernation unless you know this combination will work on your "
442 *n_low_ports_out = n_low_port;
455 int *have_low_ports_out)
470 if (BUG(!have_low_ports_out))
482 CL_PORT_SERVER_OPTIONS) < 0) {
483 *msg = tor_strdup(
"Invalid ORPort configuration");
490 CL_PORT_SERVER_OPTIONS) < 0) {
491 *msg = tor_strdup(
"Invalid ORPort configuration");
498 CL_PORT_SERVER_OPTIONS|CL_PORT_WARN_NONLOCAL) < 0) {
499 *msg = tor_strdup(
"Invalid ExtORPort configuration");
506 CL_PORT_SERVER_OPTIONS) < 0) {
507 *msg = tor_strdup(
"Invalid DirPort configuration");
512 *msg = tor_strdup(
"Misconfigured server ports");
517 smartlist_free(ports);
522 if (*have_low_ports_out < 0)
523 *have_low_ports_out = (n_low_ports > 0);
526 smartlist_free(ports);
547 options->ORPort_set =
549 options->DirPort_set =
551 options->ExtORPort_set =
583 log_warn(
LD_CONFIG,
"Tor is running as a server, but you are "
584 "running %s; this probably won't work. See "
585 "https://www.torproject.org/docs/faq.html#BestOSForRelay "
586 "for details.", uname);
619 "Nickname '%s', nicknames must be between 1 and 19 characters "
620 "inclusive, and must contain only the characters [a-zA-Z0-9].",
628 "Your ContactInfo config option is not set. Please strongly "
629 "consider setting it, so we can contact you if your relay is "
630 "misconfigured, end-of-life, or something else goes wrong. "
631 "It is also possible that your relay might get rejected from "
632 "the network due to a missing valid contact address.");
636 if (ContactInfo && !
string_is_utf8(ContactInfo, strlen(ContactInfo)))
637 REJECT(
"ContactInfo config option must be UTF-8.");
657 if (!strcasecmp(
string,
"v1"))
658 log_warn(
LD_CONFIG,
"PublishServerDescriptor v1 has no effect, because "
659 "there are no v1 directory authorities anymore.");
660 else if (!strcmp(
string,
"1"))
665 else if (!strcasecmp(
string,
"v2"))
666 log_warn(
LD_CONFIG,
"PublishServerDescriptor v2 has no effect, because "
667 "there are no v2 directory authorities anymore.");
668 else if (!strcasecmp(
string,
"v3"))
670 else if (!strcasecmp(
string,
"bridge"))
672 else if (!strcasecmp(
string,
"hidserv"))
674 "PublishServerDescriptor hidserv is invalid. See "
675 "PublishHidServDescriptors.");
676 else if (!strcasecmp(
string,
"") || !strcmp(
string,
"0"))
680 } SMARTLIST_FOREACH_END(
string);
709 const char *RECOGNIZED[] = {
710 "none",
"any",
"https",
"email",
"settings"
714 if (!strcasecmp(bd, RECOGNIZED[i]))
720 while (TOR_ISALNUM(*cp) || *cp ==
'-' || *cp ==
'_')
724 log_warn(
LD_CONFIG,
"Unrecognized BridgeDistribution value %s. I'll "
725 "assume you know what you are doing...",
escaped(bd));
753 tor_asprintf(msg,
"Unrecognized value in PublishServerDescriptor");
760 REJECT(
"Bridges are not supposed to publish router descriptors to the "
761 "directory authorities. Please correct your "
762 "PublishServerDescriptor line.");
767 REJECT(
"You set BridgeDistribution, but you didn't set BridgeRelay!");
770 REJECT(
"Invalid BridgeDistribution value.");
776 if (!strcmp(pubdes,
"1") || !strcmp(pubdes,
"0"))
777 if (smartlist_len(options->PublishServerDescriptor) > 1) {
778 COMPLAIN(
"You have passed a list of multiple arguments to the "
779 "PublishServerDescriptor option that includes 0 or 1. "
780 "0 or 1 should only be used as the sole argument. "
781 "This configuration will be rejected in a future release.");
813 REJECT(
"Relays must use 'auto' for the ConnectionPadding setting.");
817 REJECT(
"Relays cannot set ReducedConnectionPadding. ");
821 REJECT(
"Relays cannot set CircuitPadding to 0. ");
825 REJECT(
"Relays cannot set ReducedCircuitPadding. ");
854 "MaxAdvertisedBandwidth", msg) < 0)
857 "RelayBandwidthRate", msg) < 0)
860 "RelayBandwidthBurst", msg) < 0)
863 "PerConnBWRate", msg) < 0)
866 "PerConnBWBurst", msg) < 0)
875 const unsigned required_min_bw =
877 RELAY_REQUIRED_MIN_BANDWIDTH : BRIDGE_REQUIRED_MIN_BANDWIDTH;
878 const char *
const optbridge =
882 "BandwidthRate is set to %d bytes/second. "
883 "For %sservers, it must be at least %u.",
890 "MaxAdvertisedBandwidth is set to %d bytes/second. "
891 "For %sservers, it must be at least %u.",
899 "RelayBandwidthRate is set to %d bytes/second. "
900 "For %sservers, it must be at least %u.",
910 REJECT(
"RelayBandwidthBurst must be at least equal "
911 "to RelayBandwidthRate.");
946 REJECT(
"Failed to parse accounting options. See logs for details.");
949 !hs_service_non_anonymous_mode_enabled(options)) {
951 log_warn(
LD_CONFIG,
"Using accounting with a hidden service and an "
952 "ORPort is risky: your hidden service(s) and your public "
953 "address will all turn off at the same time, which may alert "
954 "observers that they are being run by the same party.");
956 "HiddenServiceDir") > 1) {
957 log_warn(
LD_CONFIG,
"Using accounting with multiple hidden services is "
958 "risky: they will all turn off at the same time, which may "
959 "alert observers that they are being run by the same party.");
963 options->AccountingRule = ACCT_MAX;
966 options->AccountingRule = ACCT_SUM;
968 options->AccountingRule = ACCT_MAX;
970 options->AccountingRule = ACCT_IN;
972 options->AccountingRule = ACCT_OUT;
974 REJECT(
"AccountingRule must be 'sum', 'max', 'in', or 'out'");
998 for (cl = lst; cl; cl = cl->next) {
999 const char *line = cl->value;
1006 SPLIT_SKIP_SPACE|SPLIT_IGNORE_BLANK|SPLIT_STRIP_SPACE, 0);
1009 char *normalized = NULL;
1020 normalized = prepended;
1033 normalized = tor_strdup(s);
1037 next->key = tor_strdup(cl->key);
1038 next->value = normalized;
1041 *new_nicknames_next = next;
1042 new_nicknames_next = &next->next;
1043 } SMARTLIST_FOREACH_END(s);
1049 config_free_lines(new_nicknames);
1054 *normalized_out = new_nicknames;
1059#define ONE_MEGABYTE (UINT64_C(1) << 20)
1062#define DIRCACHE_MIN_MEM_MB 300
1063#define DIRCACHE_MIN_MEM_BYTES (DIRCACHE_MIN_MEM_MB*ONE_MEGABYTE)
1064#define STRINGIFY(val) #val
1076 if (total_mem == 0) {
1083 if (total_mem < DIRCACHE_MIN_MEM_BYTES) {
1085 tor_asprintf(msg,
"Running a Bridge with less than %d MB of memory "
1086 "is not recommended.", DIRCACHE_MIN_MEM_MB);
1088 tor_asprintf(msg,
"Being a directory cache (default) with less than "
1089 "%d MB of memory is not recommended and may consume "
1090 "most of the available resources. Consider disabling "
1091 "this functionality by setting the DirCache option "
1092 "to 0.", DIRCACHE_MIN_MEM_MB);
1096 if (total_mem >= DIRCACHE_MIN_MEM_BYTES) {
1097 *msg = tor_strdup(
"DirCache is disabled and we are configured as a "
1098 "relay. We will not become a Guard.");
1101 return *msg == NULL ? 0 : -1;
1126 !hs_service_non_anonymous_mode_enabled(options))
1128 "Tor is currently configured as a relay and a hidden service. "
1129 "That's not very secure: you should probably run your hidden service "
1130 "in a separate Tor process, at least -- see "
1131 "https://bugs.torproject.org/tpo/core/tor/8742.");
1133 if (options->
BridgeRelay && options->DirPort_set) {
1134 log_warn(
LD_CONFIG,
"Can't set a DirPort on a bridge relay; disabling "
1138 options->DirPort_set = 0;
1141 if (options->DirPort_set && !options->
DirCache) {
1142 REJECT(
"DirPort configured but DirCache disabled. DirPort requires "
1147 REJECT(
"We're a bridge but DirCache is disabled. BridgeRelay requires "
1151 if (options->
BridgeRelay == 1 && ! options->ORPort_set)
1152 REJECT(
"BridgeRelay is 1, ORPort is not set. This is an invalid "
1157 log_warn(
LD_CONFIG,
"BridgeRelay is 1, but ExitRelay is 1 or an "
1158 "ExitPolicy is configured. Tor will start, but it will not "
1159 "function as an exit relay.");
1163 char *dircache_msg = NULL;
1165 log_warn(
LD_CONFIG,
"%s", dircache_msg);
1171 log_warn(
LD_CONFIG,
"Listing a family for a bridge relay is not "
1172 "supported: it can reveal bridge fingerprints to censors. "
1173 "You should also make sure you aren't listing this bridge's "
1174 "fingerprint in any other MyFamily.");
1177 log_warn(
LD_CONFIG,
"MyFamily is set but ContactInfo is not configured. "
1178 "ContactInfo should always be set when MyFamily option is too.");
1198 if (options->DirPort_set) {
1201 COMPLAIN(
"You have requested constrained socket buffers while also "
1202 "serving directory entries via DirPort. It is strongly "
1203 "suggested that you disable serving directory requests when "
1204 "system TCP buffer resources are scarce.");
1232 REJECT(
"SigningKeyLifetime is too short.");
1234 REJECT(
"LinkCertLifetime is too short.");
1236 REJECT(
"TestingAuthKeyLifetime is too short.");
1247 YES_IF_CHANGED_STRING(DataDirectory);
1248 YES_IF_CHANGED_INT(NumCPUs);
1249 YES_IF_CHANGED_LINELIST(ORPort_lines);
1250 YES_IF_CHANGED_BOOL(ServerDNSSearchDomains);
1251 YES_IF_CHANGED_BOOL(SafeLogging_);
1252 YES_IF_CHANGED_BOOL(ClientOnly);
1253 YES_IF_CHANGED_BOOL(LogMessageDomains);
1254 YES_IF_CHANGED_LINELIST(Logs);
1274 YES_IF_CHANGED_STRING(DataDirectory);
1275 YES_IF_CHANGED_STRING(Nickname);
1276 YES_IF_CHANGED_LINELIST(Address);
1277 YES_IF_CHANGED_LINELIST(ExitPolicy);
1278 YES_IF_CHANGED_BOOL(ExitRelay);
1279 YES_IF_CHANGED_BOOL(ExitPolicyRejectPrivate);
1280 YES_IF_CHANGED_BOOL(ExitPolicyRejectLocalInterfaces);
1281 YES_IF_CHANGED_BOOL(IPv6Exit);
1282 YES_IF_CHANGED_LINELIST(ORPort_lines);
1283 YES_IF_CHANGED_LINELIST(DirPort_lines);
1284 YES_IF_CHANGED_LINELIST(DirPort_lines);
1285 YES_IF_CHANGED_BOOL(ClientOnly);
1286 YES_IF_CHANGED_BOOL(DisableNetwork);
1287 YES_IF_CHANGED_BOOL(PublishServerDescriptor_);
1288 YES_IF_CHANGED_STRING(ContactInfo);
1289 YES_IF_CHANGED_STRING(BridgeDistribution);
1290 YES_IF_CHANGED_LINELIST(MyFamily);
1291 YES_IF_CHANGED_LINELIST(FamilyId_lines);
1292 YES_IF_CHANGED_STRING(AccountingStart);
1293 YES_IF_CHANGED_INT(AccountingMax);
1294 YES_IF_CHANGED_INT(AccountingRule);
1295 YES_IF_CHANGED_BOOL(DirCache);
1296 YES_IF_CHANGED_BOOL(AssumeReachable);
1323 const int transition_affects_workers =
1328 if (transition_affects_workers ||
1329 (authdir_mode_v3(options) && (!old_options ||
1330 !authdir_mode_v3(old_options)))) {
1332 log_warn(
LD_BUG,
"Error initializing keys; exiting");
1338 static int cdm_initialized = 0;
1339 if (cdm_initialized == 0) {
1340 cdm_initialized = 1;
1348 if (transition_affects_workers) {
1350 "Worker-related options changed. Rotating workers.");
1351 const int server_mode_turned_on =
1354 if (server_mode_turned_on) {
1384 log_warn(
LD_BUG,
"Error in previously validated accounting options");
1443#define RELAY_BRIDGE_STATS_DELAY (6 * 60 * 60)
1450 time_t int_start = time(NULL);
1452 int_start += RELAY_BRIDGE_STATS_DELAY;
1456 log_info(
LD_CONFIG,
"We are acting as a bridge now. Starting new "
1457 "GeoIP stats interval%s.", was_relay ?
" in 6 "
1458 "hours from now" :
"");
1461 log_info(
LD_GENERAL,
"We are no longer acting as a bridge. "
1462 "Forgetting GeoIP stats.");
1489 bool *print_notice_out)
1491 if (BUG(!print_notice_out))
1500 time_t now = time(NULL);
1501 int print_notice = 0;
1517 if (options->ORPort_set)
1518 log_notice(
LD_CONFIG,
"Configured to measure directory request "
1519 "statistics, but no GeoIP database found. "
1520 "Please specify a GeoIP database using the "
1521 "GeoIPFile option.");
1536 log_notice(
LD_CONFIG,
"Configured to measure entry node "
1537 "statistics, but no GeoIP database found. "
1538 "Please specify a GeoIP database using the "
1539 "GeoIPFile option.");
1553 log_info(
LD_CONFIG,
"Configured to measure hidden service statistics.");
1557 *print_notice_out = 1;
1588 log_notice(
LD_CONFIG,
"Configured to measure statistics. Look for "
1589 "the *-stats files that will first be written to the "
1590 "data directory in 24 hours from now.");
1675 "DirPortFrontPage file '%s' not found. Continuing anyway.",
const char * fmt_addrport(const tor_addr_t *addr, uint16_t port)
#define fmt_and_decorate_addr(a)
static sa_family_t tor_addr_family(const tor_addr_t *a)
#define tor_addr_eq(a, b)
Header file for directory authority mode.
int config_ensure_bandwidth_cap(uint64_t *value, const char *desc, char **msg)
or_options_t * get_options_mutable(void)
const or_options_t * get_options(void)
int port_count_real_listeners(const smartlist_t *ports, int listenertype, int count_sockets)
int port_parse_config(smartlist_t *out, const config_line_t *ports, const char *portname, int listener_type, const char *defaultaddr, int defaultport, const unsigned flags)
Header file for config.c.
int config_count_key(const config_line_t *a, const char *key)
int config_lines_eq(const config_line_t *a, const config_line_t *b)
void connection_bucket_adjust(const or_options_t *options)
Header file for connection.c.
#define CONN_TYPE_DIR_LISTENER
#define CONN_TYPE_OR_LISTENER
#define CONN_TYPE_EXT_OR_LISTENER
void connection_or_update_token_buckets(smartlist_t *conns, const or_options_t *options)
Header file for connection_or.c.
void conn_stats_terminate(void)
void conn_stats_init(time_t now)
Header for feature/stats/connstats.c.
void consdiffmgr_configure(const consdiff_cfg_t *cfg)
int consdiffmgr_validate(void)
Header for consdiffmgr.c.
void cpuworkers_rotate_keyinfo(void)
Header file for cpuworker.c.
int tor_memeq(const void *a, const void *b, size_t sz)
const char * escaped(const char *s)
int geoip_is_loaded(sa_family_t family)
Header file for geoip_stats.c.
void geoip_dirreq_stats_init(time_t now)
void geoip_bridge_stats_init(time_t now)
void geoip_bridge_stats_term(void)
void geoip_entry_stats_init(time_t now)
void geoip_dirreq_stats_term(void)
void geoip_entry_stats_term(void)
int should_record_bridge_info(const or_options_t *options)
int accounting_parse_options(const or_options_t *options, int validate_only)
void configure_accounting(time_t now)
int accounting_is_enabled(const or_options_t *options)
Header file for hibernate.c.
Header file containing service data for the HS subsystem.
void ip_address_changed(int on_client_conn)
smartlist_t * get_connection_array(void)
Header file for mainloop.c.
int get_total_system_memory(size_t *mem_out)
int is_legal_nickname(const char *s)
int is_legal_nickname_or_hexdigest(const char *s)
Header file for nickname.c.
Master header file for Tor-specific functionality.
#define UNNAMED_ROUTER_NICKNAME
int policy_using_default_exit_options(const or_options_t *or_options)
Header file for policies.c.
Listener port configuration structure.
Header file for predict_ports.c.
int tor_asprintf(char **strp, const char *fmt,...)
int tor_snprintf(char *str, size_t size, const char *format,...)
STATIC void remove_duplicate_orports(smartlist_t *ports)
STATIC int check_bridge_distribution_setting(const char *bd)
static char * global_dirfrontpagecontents
static const char * describe_portnum(int port)
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)
void relay_config_free_all(void)
int options_validate_relay_bandwidth(const or_options_t *old_options, or_options_t *options, char **msg)
static int options_transition_affects_descriptor(const or_options_t *old_options, const or_options_t *new_options)
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)
static int check_and_prune_server_ports(smartlist_t *ports, const or_options_t *options, int *n_low_ports_out)
static bool port_cfg_eq(const port_cfg_t *p1, const port_cfg_t *p2)
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)
const char * relay_get_dirportfrontpage(void)
STATIC const char * describe_relay_port(const port_cfg_t *port)
static int normalize_nickname_list(config_line_t **normalized_out, const config_line_t *lst, const char *name, char **msg)
void options_act_relay_stats_msg(void)
uint32_t relay_get_effective_bwrate(const or_options_t *options)
static int compute_publishserverdescriptor(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)
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)
int options_validate_relay_mode(const or_options_t *old_options, or_options_t *options, char **msg)
static int options_transition_affects_workers(const or_options_t *old_options, const or_options_t *new_options)
Header for feature/relay/relay_config.c.
void rep_hist_buffer_stats_term(void)
void rep_hist_hs_stats_term(void)
void rep_hist_buffer_stats_init(time_t now)
void rep_hist_exit_stats_init(time_t now)
void rep_hist_hs_stats_init(time_t now)
void rep_hist_exit_stats_term(void)
Header file for rephist.c.
void mark_my_descriptor_dirty(const char *reason)
int public_server_mode(const or_options_t *options)
int dir_server_mode(const or_options_t *options)
int server_mode(const or_options_t *options)
Header file for routermode.c.
Header file for selftest.c.
int have_capability_support(void)
void smartlist_add_all(smartlist_t *s1, const smartlist_t *s2)
smartlist_t * smartlist_new(void)
void smartlist_add(smartlist_t *sl, void *element)
void smartlist_del_keeporder(smartlist_t *sl, int idx)
#define SMARTLIST_FOREACH_BEGIN(sl, type, var)
#define SMARTLIST_FOREACH(sl, type, var, cmd)
int smartlist_split_string(smartlist_t *sl, const char *str, const char *sep, int flags, int max)
struct smartlist_t * PublishServerDescriptor
int ReducedConnectionPadding
dirinfo_type_t PublishServerDescriptor_
struct config_line_t * MyFamily
uint64_t RelayBandwidthBurst
struct config_line_t * ORPort_lines
char * BridgeDistribution
struct config_line_t * ExtORPort_lines
int TestingAuthKeyLifetime
struct config_line_t * MyFamily_lines
int HiddenServiceStatistics
int TestingLinkCertLifetime
struct config_line_t * FamilyId_lines
uint64_t RelayBandwidthRate
int TestingSigningKeySlop
uint64_t MaxAdvertisedBandwidth
int ReducedCircuitPadding
int ConnDirectionStatistics
char * AccountingRule_option
struct smartlist_t * FamilyIds
struct config_line_t * RendConfigLines
struct config_line_t * DirPort_lines
char unix_addr[FLEXIBLE_ARRAY_MEMBER]
entry_port_cfg_t entry_cfg
#define MOCK_IMPL(rv, funcname, arglist)
const char * get_uname(void)
#define IF_BUG_ONCE(cond)
int strcmpstart(const char *s1, const char *s2)
int string_is_utf8(const char *str, size_t len)