diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-06-15 14:07:17 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-06-15 14:07:17 -0400 |
commit | b8ae4111e38bc9cf6ac395b78601c150f710936f (patch) | |
tree | f142d43b31b5e18e2dc2dc7a6c90cfd795b73da5 /src/or/or.h | |
parent | 62315dab8420e44d8d469f858e88b7b4fe384122 (diff) | |
download | tor-b8ae4111e38bc9cf6ac395b78601c150f710936f.tar.gz tor-b8ae4111e38bc9cf6ac395b78601c150f710936f.zip |
Extract desc_store_t and routerlist_t into their own headers.
Diffstat (limited to 'src/or/or.h')
-rw-r--r-- | src/or/or.h | 51 |
1 files changed, 2 insertions, 49 deletions
diff --git a/src/or/or.h b/src/or/or.h index d6a42bd9da..a8ddcd2406 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -1891,55 +1891,8 @@ typedef enum store_type_t { EXTRAINFO_STORE = 1 } store_type_t; -/** A 'store' is a set of descriptors saved on disk, with accompanying - * journal, mmaped as needed, rebuilt as needed. */ -typedef struct desc_store_t { - /** Filename (within DataDir) for the store. We append .tmp to this - * filename for a temporary file when rebuilding the store, and .new to this - * filename for the journal. */ - const char *fname_base; - /** Human-readable description of what this store contains. */ - const char *description; - - tor_mmap_t *mmap; /**< A mmap for the main file in the store. */ - - store_type_t type; /**< What's stored in this store? */ - - /** The size of the router log, in bytes. */ - size_t journal_len; - /** The size of the router store, in bytes. */ - size_t store_len; - /** Total bytes dropped since last rebuild: this is space currently - * used in the cache and the journal that could be freed by a rebuild. */ - size_t bytes_dropped; -} desc_store_t; - -/** Contents of a directory of onion routers. */ -typedef struct { - /** Map from server identity digest to a member of routers. */ - struct digest_ri_map_t *identity_map; - /** Map from server descriptor digest to a signed_descriptor_t from - * routers or old_routers. */ - struct digest_sd_map_t *desc_digest_map; - /** Map from extra-info digest to an extrainfo_t. Only exists for - * routers in routers or old_routers. */ - struct digest_ei_map_t *extra_info_map; - /** Map from extra-info digests to a signed_descriptor_t for a router - * descriptor having that extra-info digest. Only exists for - * routers in routers or old_routers. */ - struct digest_sd_map_t *desc_by_eid_map; - /** List of routerinfo_t for all currently live routers we know. */ - smartlist_t *routers; - /** List of signed_descriptor_t for older router descriptors we're - * caching. */ - smartlist_t *old_routers; - /** Store holding server descriptors. If present, any router whose - * cache_info.saved_location == SAVED_IN_CACHE is stored in this file - * starting at cache_info.saved_offset */ - desc_store_t desc_store; - /** Store holding extra-info documents. */ - desc_store_t extrainfo_store; -} routerlist_t; +typedef struct desc_store_t desc_store_t; +typedef struct routerlist_t routerlist_t; /** Information on router used when extending a circuit. We don't need a * full routerinfo_t to extend: we only need addr:port:keyid to build an OR |