Merge branch 'fix-changelogs' into 'main'
[tor.git] / src / test / test_dir_common.h
blob12dd654812ff0072ec0f9d2e59b10cc73eb7cfca
1 /* Copyright (c) 2001-2004, Roger Dingledine.
2 * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
3 * Copyright (c) 2007-2021, The Tor Project, Inc. */
4 /* See LICENSE for licensing information */
6 #ifndef TOR_TEST_DIR_COMMON_H
7 #define TOR_TEST_DIR_COMMON_H
9 #include "core/or/or.h"
10 #include "feature/nodelist/networkstatus.h"
12 #define TEST_DIR_ROUTER_ID_1 3
13 #define TEST_DIR_ROUTER_ID_2 5
14 #define TEST_DIR_ROUTER_ID_3 33
15 #define TEST_DIR_ROUTER_ID_4 34
17 #define TEST_DIR_ROUTER_DD_1 78
18 #define TEST_DIR_ROUTER_DD_2 77
19 #define TEST_DIR_ROUTER_DD_3 79
20 #define TEST_DIR_ROUTER_DD_4 44
22 int dir_common_authority_pk_init(authority_cert_t **cert1,
23 authority_cert_t **cert2,
24 authority_cert_t **cert3,
25 crypto_pk_t **sign_skey_1,
26 crypto_pk_t **sign_skey_2,
27 crypto_pk_t **sign_skey_3);
29 routerinfo_t * dir_common_generate_ri_from_rs(const vote_routerstatus_t *vrs);
31 vote_routerstatus_t * dir_common_gen_routerstatus_for_v3ns(int idx,
32 time_t now);
34 int dir_common_construct_vote_1(networkstatus_t **vote,
35 authority_cert_t *cert1,
36 crypto_pk_t *sign_skey,
37 vote_routerstatus_t * (*vrs_gen)(int idx, time_t now),
38 networkstatus_t **vote_out, int *n_vrs, time_t now,
39 int clear_rl);
41 int dir_common_construct_vote_2(networkstatus_t **vote,
42 authority_cert_t *cert2,
43 crypto_pk_t *sign_skey,
44 vote_routerstatus_t * (*vrs_gen)(int idx, time_t now),
45 networkstatus_t **vote_out, int *n_vrs, time_t now,
46 int clear_rl);
48 int dir_common_construct_vote_3(networkstatus_t **vote,
49 authority_cert_t *cert3,
50 crypto_pk_t *sign_skey,
51 vote_routerstatus_t * (*vrs_gen)(int idx, time_t now),
52 networkstatus_t **vote_out, int *n_vrs, time_t now,
53 int clear_rl);
55 #endif /* !defined(TOR_TEST_DIR_COMMON_H) */