sr: Static inline functions if no dirauth module

Add static inline dirauth public functions used outside of the dirauth module
so they can be seen by the tor code but simply do nothing.

Signed-off-by: David Goulet <dgoulet@torproject.org>
This commit is contained in:
David Goulet 2018-04-24 15:28:47 -04:00
parent bdcf3a3839
commit 79a1112a49
1 changed files with 30 additions and 1 deletions

View File

@ -101,11 +101,40 @@ typedef struct sr_commit_t {
/* API */
/* Public methods: */
/* Public methods used _outside_ of the module.
*
* We need to nullify them if the module is disabled. */
#ifdef HAVE_MODULE_DIRAUTH
int sr_init(int save_to_disk);
void sr_save_and_cleanup(void);
void sr_act_post_consensus(const networkstatus_t *consensus);
#else /* HAVE_MODULE_DIRAUTH */
static inline int
sr_init(int save_to_disk)
{
(void) save_to_disk;
/* Always return success. */
return 0;
}
static inline void
sr_save_and_cleanup(void)
{
}
static inline void
sr_act_post_consensus(const networkstatus_t *consensus)
{
(void) consensus;
}
#endif /* HAVE_MODULE_DIRAUTH */
/* Public methods used only by dirauth code. */
void sr_handle_received_commits(smartlist_t *commits,
crypto_pk_t *voter_key);
sr_commit_t *sr_parse_commit(const smartlist_t *args);