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-2021, The Tor Project, Inc. */
5 /* See LICENSE for licensing information */
8 * @file desc_store_st.h
9 * @brief Routerinfo/extrainfo storage structure.
12 #ifndef DESC_STORE_ST_H
13 #define DESC_STORE_ST_H
15 /** Allowable types of desc_store_t. */
16 typedef enum store_type_t
{
21 /** A 'store' is a set of descriptors saved on disk, with accompanying
22 * journal, mmaped as needed, rebuilt as needed. */
24 /** Filename (within DataDir) for the store. We append .tmp to this
25 * filename for a temporary file when rebuilding the store, and .new to this
26 * filename for the journal. */
27 const char *fname_base
;
28 /** Human-readable description of what this store contains. */
29 const char *description
;
31 tor_mmap_t
*mmap
; /**< A mmap for the main file in the store. */
33 store_type_t type
; /**< What's stored in this store? */
35 /** The size of the router log, in bytes. */
37 /** The size of the router store, in bytes. */
39 /** Total bytes dropped since last rebuild: this is space currently
40 * used in the cache and the journal that could be freed by a rebuild. */
44 #endif /* !defined(DESC_STORE_ST_H) */