2018-09-25 16:00:50 -04:00
|
|
|
/* Copyright (c) 2001 Matej Pfajfar.
|
|
|
|
* Copyright (c) 2001-2004, Roger Dingledine.
|
|
|
|
* Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
|
2019-01-16 12:33:22 -05:00
|
|
|
* Copyright (c) 2007-2019, The Tor Project, Inc. */
|
2018-09-25 16:00:50 -04:00
|
|
|
/* See LICENSE for licensing information */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \file routermode.h
|
|
|
|
* \brief Header file for routermode.c.
|
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef TOR_ROUTERMODE_H
|
|
|
|
#define TOR_ROUTERMODE_H
|
|
|
|
|
2019-10-18 13:28:02 +10:00
|
|
|
#ifdef HAVE_MODULE_RELAY
|
|
|
|
|
2018-09-25 16:00:50 -04:00
|
|
|
int dir_server_mode(const or_options_t *options);
|
|
|
|
|
|
|
|
MOCK_DECL(int, server_mode, (const or_options_t *options));
|
|
|
|
MOCK_DECL(int, public_server_mode, (const or_options_t *options));
|
|
|
|
MOCK_DECL(int, advertised_server_mode, (void));
|
|
|
|
|
|
|
|
void set_server_advertised(int s);
|
|
|
|
|
2019-10-21 12:47:17 -04:00
|
|
|
/** Is the relay module enabled? */
|
2019-10-18 13:28:02 +10:00
|
|
|
#define have_module_relay() (1)
|
|
|
|
|
2019-10-22 09:40:31 -04:00
|
|
|
#else /* !defined(HAVE_MODULE_RELAY) */
|
2019-10-18 13:28:02 +10:00
|
|
|
|
|
|
|
#define dir_server_mode(options) (((void)(options)),0)
|
|
|
|
#define server_mode(options) (((void)(options)),0)
|
|
|
|
#define public_server_mode(options) (((void)(options)),0)
|
|
|
|
#define advertised_server_mode() (0)
|
|
|
|
|
|
|
|
/* We shouldn't be publishing descriptors when relay mode is disabled. */
|
|
|
|
#define set_server_advertised(s) tor_assert_nonfatal(!(s))
|
|
|
|
|
|
|
|
#define have_module_relay() (0)
|
|
|
|
|
2019-10-22 09:40:31 -04:00
|
|
|
#endif /* defined(HAVE_MODULE_RELAY) */
|
2019-10-18 13:28:02 +10:00
|
|
|
|
2018-09-25 16:00:50 -04:00
|
|
|
#endif /* !defined(TOR_ROUTERMODE_H) */
|