microdesc.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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-2013, 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. void microdesc_check_counts(void);
  14. smartlist_t *microdescs_add_to_cache(microdesc_cache_t *cache,
  15. const char *s, const char *eos, saved_location_t where,
  16. int no_save, time_t listed_at,
  17. smartlist_t *requested_digests256);
  18. smartlist_t *microdescs_add_list_to_cache(microdesc_cache_t *cache,
  19. smartlist_t *descriptors, saved_location_t where,
  20. int no_save);
  21. void microdesc_cache_clean(microdesc_cache_t *cache, time_t cutoff, int force);
  22. int microdesc_cache_rebuild(microdesc_cache_t *cache, int force);
  23. int microdesc_cache_reload(microdesc_cache_t *cache);
  24. void microdesc_cache_clear(microdesc_cache_t *cache);
  25. microdesc_t *microdesc_cache_lookup_by_digest256(microdesc_cache_t *cache,
  26. const char *d);
  27. size_t microdesc_average_size(microdesc_cache_t *cache);
  28. smartlist_t *microdesc_list_missing_digest256(networkstatus_t *ns,
  29. microdesc_cache_t *cache,
  30. int downloadable_only,
  31. digestmap_t *skip);
  32. void microdesc_free(microdesc_t *md);
  33. void microdesc_free_all(void);
  34. void update_microdesc_downloads(time_t now);
  35. void update_microdescs_from_networkstatus(time_t now);
  36. int usable_consensus_flavor(void);
  37. int we_fetch_microdescriptors(const or_options_t *options);
  38. int we_fetch_router_descriptors(const or_options_t *options);
  39. int we_use_microdescriptors_for_circuits(const or_options_t *options);
  40. #endif