Tor
0.4.7.0-alpha-dev
|
Check if we're running as a relay/cache. More...
#include "core/or/or.h"
#include "app/config/config.h"
#include "feature/relay/router.h"
#include "feature/relay/routermode.h"
Go to the source code of this file.
Functions | |
int | dir_server_mode (const or_options_t *options) |
int | server_mode (const or_options_t *options) |
int | public_server_mode (const or_options_t *options) |
int | advertised_server_mode (void) |
void | set_server_advertised (int s) |
Variables | |
static int | server_is_advertised =0 |
Check if we're running as a relay/cache.
Definition in file routermode.c.
int advertised_server_mode | ( | void | ) |
Return true iff we have published our descriptor lately.
Definition at line 55 of file routermode.c.
Referenced by dirclient_fetches_from_authorities(), and directory_caches_dir_info().
int dir_server_mode | ( | const or_options_t * | options | ) |
Return 1 if we are configured to accept either relay or directory requests from clients and we aren't at risk of exceeding our bandwidth limits, thus we should be a directory server. If not, return 0.
Definition at line 23 of file routermode.c.
Referenced by dirclient_fetches_from_authorities(), directory_caches_dir_info(), directory_caches_unknown_auth_certs(), and directory_permits_begindir_requests().
int public_server_mode | ( | const or_options_t * | options | ) |
Return true iff we are trying to be a non-bridge server.
Definition at line 43 of file routermode.c.
Referenced by assert_identity_keys_ok(), check_dns_honesty_callback(), hs_dos_consensus_has_changed(), log_heartbeat(), networkstatus_consensus_can_use_multiple_directories(), options_act_relay_dir(), options_act_relay_dos(), router_initialize_tls_context(), and should_use_directory_guards().
int server_mode | ( | const or_options_t * | options | ) |
Return true iff we are trying to be a server.
Definition at line 34 of file routermode.c.
Referenced by check_for_reachability_bw_callback(), check_network_configuration(), check_network_participation_callback(), circuit_note_clock_jumped(), circuit_send_intermediate_onion_skin(), circuit_testing_failed(), connection_finished_connecting(), connection_or_check_valid_tls_handshake(), connection_or_connect(), consider_publishable_server(), dir_server_mode(), dirclient_fetches_from_authorities(), directory_caches_dir_info(), directory_info_has_arrived(), dns_init(), dns_reset(), dns_servers_relaunch_checks(), extend_info_pick_orport(), generate_ed_link_cert(), handle_missing_protocol_warning(), ip_address_changed(), public_server_mode(), reachability_warnings_callback(), reachable_addr_allows(), reachable_addr_prefer_ipv6_impl(), relay_address_new_suggestion(), rep_hist_circbuilding_dormant(), retry_dns_callback(), router_get_my_extrainfo(), router_get_my_routerinfo_with_err(), and server_identity_key_is_set().
void set_server_advertised | ( | int | s | ) |
Called with a boolean: set whether we have recently published our descriptor.
Definition at line 65 of file routermode.c.
Referenced by consider_publishable_server().
|
static |
Remember if we've advertised ourselves to the dirservers.
Definition at line 50 of file routermode.c.
Referenced by advertised_server_mode(), and set_server_advertised().