microdesc.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /* Copyright (c) 2001 Matej Pfajfar.
  2. * Copyright (c) 2001-2004, Roger Dingledine.
  3. * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
  4. * Copyright (c) 2007-2010, The Tor Project, Inc. */
  5. /* See LICENSE for licensing information */
  6. /**
  7. * \file microdesc.h
  8. * \brief Header file for microdesc.c.
  9. **/
  10. #ifndef _TOR_MICRODESC_H
  11. #define _TOR_MICRODESC_H
  12. microdesc_cache_t *get_microdesc_cache(void);
  13. smartlist_t *microdescs_add_to_cache(microdesc_cache_t *cache,
  14. const char *s, const char *eos, saved_location_t where,
  15. int no_save, time_t listed_at,
  16. smartlist_t *requested_digests256);
  17. smartlist_t *microdescs_add_list_to_cache(microdesc_cache_t *cache,
  18. smartlist_t *descriptors, saved_location_t where,
  19. int no_save);
  20. int microdesc_cache_rebuild(microdesc_cache_t *cache);
  21. int microdesc_cache_reload(microdesc_cache_t *cache);
  22. void microdesc_cache_clear(microdesc_cache_t *cache);
  23. microdesc_t *microdesc_cache_lookup_by_digest256(microdesc_cache_t *cache,
  24. const char *d);
  25. size_t microdesc_average_size(microdesc_cache_t *cache);
  26. smartlist_t *microdesc_list_missing_digest256(networkstatus_t *ns,
  27. microdesc_cache_t *cache,
  28. int downloadable_only,
  29. digestmap_t *skip);
  30. void microdesc_free(microdesc_t *md);
  31. void microdesc_free_all(void);
  32. void update_microdesc_downloads(time_t now);
  33. #endif