2018-09-20 14:09:35 +02:00
|
|
|
/* Copyright (c) 2001 Matej Pfajfar.
|
|
|
|
* Copyright (c) 2001-2004, Roger Dingledine.
|
|
|
|
* Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
|
2019-01-16 18:33:22 +01:00
|
|
|
* Copyright (c) 2007-2019, The Tor Project, Inc. */
|
2018-09-20 14:09:35 +02:00
|
|
|
/* See LICENSE for licensing information */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \file process_descs.h
|
|
|
|
* \brief Header file for process_descs.c.
|
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef TOR_RECV_UPLOADS_H
|
|
|
|
#define TOR_RECV_UPLOADS_H
|
|
|
|
|
2019-08-29 17:18:42 +02:00
|
|
|
// for was_router_added_t.
|
|
|
|
#include "feature/nodelist/routerlist.h"
|
|
|
|
|
2018-09-20 14:09:35 +02:00
|
|
|
void dirserv_free_fingerprint_list(void);
|
|
|
|
|
2019-08-29 17:18:42 +02:00
|
|
|
#ifdef HAVE_MODULE_DIRAUTH
|
|
|
|
int dirserv_load_fingerprint_file(void);
|
2018-09-20 14:09:35 +02:00
|
|
|
enum was_router_added_t dirserv_add_multiple_descriptors(
|
2018-08-29 10:49:10 +02:00
|
|
|
const char *desc, size_t desclen,
|
|
|
|
uint8_t purpose,
|
2018-09-20 14:09:35 +02:00
|
|
|
const char *source,
|
|
|
|
const char **msg);
|
|
|
|
enum was_router_added_t dirserv_add_descriptor(routerinfo_t *ri,
|
|
|
|
const char **msg,
|
|
|
|
const char *source);
|
|
|
|
|
2019-08-29 17:18:42 +02:00
|
|
|
int dirserv_would_reject_router(const routerstatus_t *rs);
|
2018-09-20 14:09:35 +02:00
|
|
|
int authdir_wants_to_reject_router(routerinfo_t *ri, const char **msg,
|
|
|
|
int complain,
|
|
|
|
int *valid_out);
|
2019-08-29 17:18:42 +02:00
|
|
|
int dirserv_add_own_fingerprint(crypto_pk_t *pk);
|
2018-09-20 14:09:35 +02:00
|
|
|
uint32_t dirserv_router_get_status(const routerinfo_t *router,
|
|
|
|
const char **msg,
|
|
|
|
int severity);
|
|
|
|
void dirserv_set_node_flags_from_authoritative_status(node_t *node,
|
|
|
|
uint32_t authstatus);
|
2019-09-16 19:27:42 +02:00
|
|
|
#else /* !(defined(HAVE_MODULE_DIRAUTH)) */
|
2019-08-29 15:50:38 +02:00
|
|
|
static inline int
|
2019-08-29 17:18:42 +02:00
|
|
|
dirserv_load_fingerprint_file(void)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
static inline enum was_router_added_t
|
|
|
|
dirserv_add_multiple_descriptors(const char *desc, size_t desclen,
|
|
|
|
uint8_t purpose,
|
|
|
|
const char *source,
|
|
|
|
const char **msg)
|
|
|
|
{
|
|
|
|
(void)desc;
|
|
|
|
(void)desclen;
|
|
|
|
(void)purpose;
|
|
|
|
(void)source;
|
|
|
|
(void)msg;
|
|
|
|
return (enum was_router_added_t)0;
|
|
|
|
}
|
|
|
|
static inline enum was_router_added_t
|
|
|
|
dirserv_add_descriptor(routerinfo_t *ri,
|
|
|
|
const char **msg,
|
|
|
|
const char *source)
|
|
|
|
{
|
|
|
|
(void)ri;
|
|
|
|
(void)msg;
|
|
|
|
(void)source;
|
|
|
|
return (enum was_router_added_t)0;
|
|
|
|
}
|
|
|
|
static inline int
|
2019-08-29 15:50:38 +02:00
|
|
|
dirserv_would_reject_router(const routerstatus_t *rs)
|
|
|
|
{
|
|
|
|
(void)rs;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
static inline int
|
|
|
|
authdir_wants_to_reject_router(routerinfo_t *ri, const char **msg,
|
|
|
|
int complain,
|
|
|
|
int *valid_out)
|
|
|
|
{
|
|
|
|
(void)ri;
|
|
|
|
(void)msg;
|
|
|
|
(void)complain;
|
|
|
|
(void)valid_out;
|
|
|
|
return 0;
|
|
|
|
}
|
2019-08-29 17:18:42 +02:00
|
|
|
static inline int
|
|
|
|
dirserv_add_own_fingerprint(crypto_pk_t *pk)
|
|
|
|
{
|
|
|
|
(void)pk;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
static inline uint32_t
|
|
|
|
dirserv_router_get_status(const routerinfo_t *router,
|
|
|
|
const char **msg,
|
|
|
|
int severity)
|
|
|
|
{
|
|
|
|
(void)router;
|
|
|
|
(void)msg;
|
|
|
|
(void)severity;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
static inline void
|
|
|
|
dirserv_set_node_flags_from_authoritative_status(node_t *node,
|
|
|
|
uint32_t authstatus)
|
|
|
|
{
|
|
|
|
(void)node;
|
|
|
|
(void)authstatus;
|
|
|
|
}
|
2019-09-16 19:27:42 +02:00
|
|
|
#endif /* defined(HAVE_MODULE_DIRAUTH) */
|
2018-09-20 14:09:35 +02:00
|
|
|
|
2019-07-19 18:56:02 +02:00
|
|
|
#ifdef TOR_UNIT_TESTS
|
|
|
|
STATIC int dirserv_router_has_valid_address(routerinfo_t *ri);
|
|
|
|
#endif /* defined(TOR_UNIT_TESTS) */
|
|
|
|
|
2019-06-05 15:33:35 +02:00
|
|
|
#endif /* !defined(TOR_RECV_UPLOADS_H) */
|