hs_common.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /* Copyright (c) 2016, The Tor Project, Inc. */
  2. /* See LICENSE for licensing information */
  3. /**
  4. * \file hs_common.h
  5. * \brief Header file containing common data for the whole HS subsytem.
  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. /* Version 3 of the protocol (prop224). */
  14. #define HS_VERSION_THREE 3
  15. void rend_data_free(rend_data_t *data);
  16. rend_data_t *rend_data_dup(const rend_data_t *data);
  17. rend_data_t *rend_data_client_create(const char *onion_address,
  18. const char *desc_id,
  19. const char *cookie,
  20. rend_auth_type_t auth_type);
  21. rend_data_t *rend_data_service_create(const char *onion_address,
  22. const char *pk_digest,
  23. const uint8_t *cookie,
  24. rend_auth_type_t auth_type);
  25. const char *rend_data_get_address(const rend_data_t *rend_data);
  26. const char *rend_data_get_desc_id(const rend_data_t *rend_data,
  27. uint8_t replica, size_t *len_out);
  28. const uint8_t *rend_data_get_pk_digest(const rend_data_t *rend_data,
  29. size_t *len_out);
  30. #endif /* TOR_HS_COMMON_H */