hs_common.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. /* Copyright (c) 2016, The Tor Project, Inc. */
  2. /* See LICENSE for licensing information */
  3. /**
  4. * \file hs_common.h
  5. * \brief Header file for hs_common.c.
  6. **/
  7. #ifndef TOR_HS_COMMON_H
  8. #define TOR_HS_COMMON_H
  9. #include "or.h"
  10. /* Protocol version 2. Use this instead of hardcoding "2" in the code base,
  11. * this adds a clearer semantic to the value when used. */
  12. #define HS_VERSION_TWO 2
  13. void rend_data_free(rend_data_t *data);
  14. rend_data_t *rend_data_dup(const rend_data_t *data);
  15. rend_data_t *rend_data_client_create(const char *onion_address,
  16. const char *desc_id,
  17. const char *cookie,
  18. rend_auth_type_t auth_type);
  19. rend_data_t *rend_data_service_create(const char *onion_address,
  20. const char *pk_digest,
  21. const uint8_t *cookie,
  22. rend_auth_type_t auth_type);
  23. const char *rend_data_get_address(const rend_data_t *rend_data);
  24. const char *rend_data_get_desc_id(const rend_data_t *rend_data,
  25. uint8_t replica, size_t *len_out);
  26. const uint8_t *rend_data_get_pk_digest(const rend_data_t *rend_data,
  27. size_t *len_out);
  28. #endif /* TOR_HS_COMMON_H */