aboutsummaryrefslogtreecommitdiff
path: root/src/or/or.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-08-31 15:08:37 +0000
committerNick Mathewson <nickm@torproject.org>2007-08-31 15:08:37 +0000
commitc967fae598d4bd3a1d1208ca990c0625723ff751 (patch)
tree83212c606c2c5797e89deec6cb528f673bc663ce /src/or/or.h
parent2ff871e530aba2191f289b9e055af4d873fd30fa (diff)
downloadtor-c967fae598d4bd3a1d1208ca990c0625723ff751.tar.gz
tor-c967fae598d4bd3a1d1208ca990c0625723ff751.zip
r14880@catbus: nickm | 2007-08-31 11:06:10 -0400
Refactor store_stats_t to hold a pointer to the proper mmap, and turn it into a full-fledged type. This sets stuff up nicely for adding a separate "annotated" store. Add some XXXX NM items that need to be fixed when annotated stores exist svn:r11338
Diffstat (limited to 'src/or/or.h')
-rw-r--r--src/or/or.h34
1 files changed, 30 insertions, 4 deletions
diff --git a/src/or/or.h b/src/or/or.h
index f5ad821a4e..72fd36133e 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -1403,6 +1403,30 @@ typedef struct ns_detached_signatures_t {
smartlist_t *signatures; /* list of networkstatus_voter_info_t */
} ns_detached_signatures_t;
+typedef enum store_type_t {
+ ROUTER_STORE,
+ ANNOTATED_ROUTER_STORE,
+ EXTRAINFO_STORE
+} store_type_t;
+
+/** DOCDOC */
+typedef struct desc_store_t {
+ const char *fname_base;
+ const char *description;
+
+ tor_mmap_t *mmap;
+
+ store_type_t type;
+
+ /** 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. */
@@ -1422,12 +1446,14 @@ typedef struct {
/** List of signed_descriptor_t for older router descriptors we're
* caching. */
smartlist_t *old_routers;
- /** Mmaped file holding server descriptors. If present, any router whose
- * cache_info.saved_location == SAVED_IN_CACHE is stored in this file
+ /** DOCDOC Mmaped file 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 */
- tor_mmap_t *mmap_descriptors;
+ desc_store_t desc_store;
+ /** DOCDOC */
+ desc_store_t annotated_desc_store;
/** Mmaped file holding extra-info documents. */
- tor_mmap_t *mmap_extrainfo;
+ desc_store_t extrainfo_store;
} routerlist_t;
/** Information on router used when extending a circuit. We don't need a