test_dir_common.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. #ifndef TOR_TEST_DIR_COMMON_H
  6. #define TOR_TEST_DIR_COMMON_H
  7. #include "core/or/or.h"
  8. #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
  13. #define TEST_DIR_ROUTER_DD_1 78
  14. #define TEST_DIR_ROUTER_DD_2 77
  15. #define TEST_DIR_ROUTER_DD_3 79
  16. #define TEST_DIR_ROUTER_DD_4 44
  17. int dir_common_authority_pk_init(authority_cert_t **cert1,
  18. authority_cert_t **cert2,
  19. authority_cert_t **cert3,
  20. crypto_pk_t **sign_skey_1,
  21. crypto_pk_t **sign_skey_2,
  22. crypto_pk_t **sign_skey_3);
  23. routerinfo_t * dir_common_generate_ri_from_rs(const vote_routerstatus_t *vrs);
  24. vote_routerstatus_t * dir_common_gen_routerstatus_for_v3ns(int idx,
  25. time_t now);
  26. int dir_common_construct_vote_1(networkstatus_t **vote,
  27. authority_cert_t *cert1,
  28. crypto_pk_t *sign_skey,
  29. vote_routerstatus_t * (*vrs_gen)(int idx, time_t now),
  30. networkstatus_t **vote_out, int *n_vrs, time_t now,
  31. int clear_rl);
  32. int dir_common_construct_vote_2(networkstatus_t **vote,
  33. authority_cert_t *cert2,
  34. crypto_pk_t *sign_skey,
  35. vote_routerstatus_t * (*vrs_gen)(int idx, time_t now),
  36. networkstatus_t **vote_out, int *n_vrs, time_t now,
  37. int clear_rl);
  38. int dir_common_construct_vote_3(networkstatus_t **vote,
  39. authority_cert_t *cert3,
  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,
  43. int clear_rl);
  44. #endif /* !defined(TOR_TEST_DIR_COMMON_H) */