Tor  0.4.7.0-alpha-dev
Functions | Variables
routermode.c File Reference

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
 

Detailed Description

Check if we're running as a relay/cache.

Definition in file routermode.c.

Function Documentation

◆ advertised_server_mode()

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().

◆ dir_server_mode()

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().

◆ public_server_mode()

int public_server_mode ( const or_options_t options)

◆ server_mode()

int server_mode ( const or_options_t options)

◆ set_server_advertised()

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().

Variable Documentation

◆ server_is_advertised

int server_is_advertised =0
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().