test_dir_common.h 2.1 KB

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