test_dir_common.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 */
  5. #include "core/or/or.h"
  6. #include "feature/nodelist/networkstatus.h"
  7. #define TEST_DIR_ROUTER_ID_1 3
  8. #define TEST_DIR_ROUTER_ID_2 5
  9. #define TEST_DIR_ROUTER_ID_3 33
  10. #define TEST_DIR_ROUTER_ID_4 34
  11. #define TEST_DIR_ROUTER_DD_1 78
  12. #define TEST_DIR_ROUTER_DD_2 77
  13. #define TEST_DIR_ROUTER_DD_3 79
  14. #define TEST_DIR_ROUTER_DD_4 44
  15. int dir_common_authority_pk_init(authority_cert_t **cert1,
  16. authority_cert_t **cert2,
  17. authority_cert_t **cert3,
  18. crypto_pk_t **sign_skey_1,
  19. crypto_pk_t **sign_skey_2,
  20. crypto_pk_t **sign_skey_3);
  21. routerinfo_t * dir_common_generate_ri_from_rs(const vote_routerstatus_t *vrs);
  22. vote_routerstatus_t * dir_common_gen_routerstatus_for_v3ns(int idx,
  23. time_t now);
  24. int dir_common_construct_vote_1(networkstatus_t **vote,
  25. authority_cert_t *cert1,
  26. crypto_pk_t *sign_skey,
  27. vote_routerstatus_t * (*vrs_gen)(int idx, time_t now),
  28. networkstatus_t **vote_out, int *n_vrs, time_t now,
  29. int clear_rl);
  30. int dir_common_construct_vote_2(networkstatus_t **vote,
  31. authority_cert_t *cert2,
  32. crypto_pk_t *sign_skey,
  33. vote_routerstatus_t * (*vrs_gen)(int idx, time_t now),
  34. networkstatus_t **vote_out, int *n_vrs, time_t now,
  35. int clear_rl);
  36. int dir_common_construct_vote_3(networkstatus_t **vote,
  37. authority_cert_t *cert3,
  38. crypto_pk_t *sign_skey,
  39. vote_routerstatus_t * (*vrs_gen)(int idx, time_t now),
  40. networkstatus_t **vote_out, int *n_vrs, time_t now,
  41. int clear_rl);