1 /* Copyright (c) 2001-2004, Roger Dingledine.
2 * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
3 * Copyright (c) 2007-2019, The Tor Project, Inc. */
4 /* See LICENSE for licensing information */
6 #include "core/or/or.h"
7 #include "feature/nodelist/networkstatus.h"
9 #define TEST_DIR_ROUTER_ID_1 3
10 #define TEST_DIR_ROUTER_ID_2 5
11 #define TEST_DIR_ROUTER_ID_3 33
12 #define TEST_DIR_ROUTER_ID_4 34
14 #define TEST_DIR_ROUTER_DD_1 78
15 #define TEST_DIR_ROUTER_DD_2 77
16 #define TEST_DIR_ROUTER_DD_3 79
17 #define TEST_DIR_ROUTER_DD_4 44
19 int dir_common_authority_pk_init(authority_cert_t
**cert1
,
20 authority_cert_t
**cert2
,
21 authority_cert_t
**cert3
,
22 crypto_pk_t
**sign_skey_1
,
23 crypto_pk_t
**sign_skey_2
,
24 crypto_pk_t
**sign_skey_3
);
26 routerinfo_t
* dir_common_generate_ri_from_rs(const vote_routerstatus_t
*vrs
);
28 vote_routerstatus_t
* dir_common_gen_routerstatus_for_v3ns(int idx
,
31 int dir_common_construct_vote_1(networkstatus_t
**vote
,
32 authority_cert_t
*cert1
,
33 crypto_pk_t
*sign_skey
,
34 vote_routerstatus_t
* (*vrs_gen
)(int idx
, time_t now
),
35 networkstatus_t
**vote_out
, int *n_vrs
, time_t now
,
38 int dir_common_construct_vote_2(networkstatus_t
**vote
,
39 authority_cert_t
*cert2
,
40 crypto_pk_t
*sign_skey
,
41 vote_routerstatus_t
* (*vrs_gen
)(int idx
, time_t now
),
42 networkstatus_t
**vote_out
, int *n_vrs
, time_t now
,
45 int dir_common_construct_vote_3(networkstatus_t
**vote
,
46 authority_cert_t
*cert3
,
47 crypto_pk_t
*sign_skey
,
48 vote_routerstatus_t
* (*vrs_gen
)(int idx
, time_t now
),
49 networkstatus_t
**vote_out
, int *n_vrs
, time_t now
,