desc_store_st.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  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-2018, The Tor Project, Inc. */
  5. /* See LICENSE for licensing information */
  6. #ifndef DESC_STORE_ST_H
  7. #define DESC_STORE_ST_H
  8. /** A 'store' is a set of descriptors saved on disk, with accompanying
  9. * journal, mmaped as needed, rebuilt as needed. */
  10. struct desc_store_t {
  11. /** Filename (within DataDir) for the store. We append .tmp to this
  12. * filename for a temporary file when rebuilding the store, and .new to this
  13. * filename for the journal. */
  14. const char *fname_base;
  15. /** Human-readable description of what this store contains. */
  16. const char *description;
  17. tor_mmap_t *mmap; /**< A mmap for the main file in the store. */
  18. store_type_t type; /**< What's stored in this store? */
  19. /** The size of the router log, in bytes. */
  20. size_t journal_len;
  21. /** The size of the router store, in bytes. */
  22. size_t store_len;
  23. /** Total bytes dropped since last rebuild: this is space currently
  24. * used in the cache and the journal that could be freed by a rebuild. */
  25. size_t bytes_dropped;
  26. };
  27. #endif