aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-06-15 15:06:00 -0400
committerNick Mathewson <nickm@torproject.org>2018-06-15 15:06:00 -0400
commit958df2829a9248cf8518aafd9e19da48ce14cf64 (patch)
tree6439cc32a6066e9b5a4183e9acf1d42ab337639c /src/or
parentf85d731e3af16e72682f68be4f598f08ed227618 (diff)
downloadtor-958df2829a9248cf8518aafd9e19da48ce14cf64.tar.gz
tor-958df2829a9248cf8518aafd9e19da48ce14cf64.zip
Extract cached_dir_t into a new header.
Diffstat (limited to 'src/or')
-rw-r--r--src/or/cached_dir_st.h25
-rw-r--r--src/or/control.c1
-rw-r--r--src/or/dirauth/dirvote.c1
-rw-r--r--src/or/directory.c1
-rw-r--r--src/or/dirserv.c1
-rw-r--r--src/or/include.am1
-rw-r--r--src/or/or.h14
7 files changed, 31 insertions, 13 deletions
diff --git a/src/or/cached_dir_st.h b/src/or/cached_dir_st.h
new file mode 100644
index 0000000000..4f930b6fb9
--- /dev/null
+++ b/src/or/cached_dir_st.h
@@ -0,0 +1,25 @@
+/* Copyright (c) 2001 Matej Pfajfar.
+ * Copyright (c) 2001-2004, Roger Dingledine.
+ * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
+ * Copyright (c) 2007-2017, The Tor Project, Inc. */
+/* See LICENSE for licensing information */
+
+#ifndef CACHED_DIR_ST_H
+#define CACHED_DIR_ST_H
+
+/** A cached_dir_t represents a cacheable directory object, along with its
+ * compressed form. */
+struct cached_dir_t {
+ char *dir; /**< Contents of this object, NUL-terminated. */
+ char *dir_compressed; /**< Compressed contents of this object. */
+ size_t dir_len; /**< Length of <b>dir</b> (not counting its NUL). */
+ size_t dir_compressed_len; /**< Length of <b>dir_compressed</b>. */
+ time_t published; /**< When was this object published. */
+ common_digests_t digests; /**< Digests of this object (networkstatus only) */
+ /** Sha3 digest (also ns only) */
+ uint8_t digest_sha3_as_signed[DIGEST256_LEN];
+ int refcnt; /**< Reference count for this cached_dir_t. */
+};
+
+#endif
+
diff --git a/src/or/control.c b/src/or/control.c
index 520b6178f7..075b62a58a 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -81,6 +81,7 @@
#include "routerparse.h"
#include "shared_random_client.h"
+#include "cached_dir_st.h"
#include "control_connection_st.h"
#include "cpath_build_state_st.h"
#include "entry_connection_st.h"
diff --git a/src/or/dirauth/dirvote.c b/src/or/dirauth/dirvote.c
index 94a6139f57..c39708f4e4 100644
--- a/src/or/dirauth/dirvote.c
+++ b/src/or/dirauth/dirvote.c
@@ -29,6 +29,7 @@
#include "dirauth/shared_random_state.h"
#include "authority_cert_st.h"
+#include "cached_dir_st.h"
#include "dir_server_st.h"
#include "document_signature_st.h"
#include "microdesc_st.h"
diff --git a/src/or/directory.c b/src/or/directory.c
index f6d6d28d4a..2394b75b2e 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -55,6 +55,7 @@
#include "dirauth/shared_random.h"
#include "authority_cert_st.h"
+#include "cached_dir_st.h"
#include "dir_connection_st.h"
#include "dir_server_st.h"
#include "entry_connection_st.h"
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index e54782d196..68f411b486 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -36,6 +36,7 @@
#include "dirauth/dirvote.h"
+#include "cached_dir_st.h"
#include "dir_connection_st.h"
#include "extrainfo_st.h"
#include "microdesc_st.h"
diff --git a/src/or/include.am b/src/or/include.am
index c28e95f052..cc059ef514 100644
--- a/src/or/include.am
+++ b/src/or/include.am
@@ -195,6 +195,7 @@ ORHEADERS = \
src/or/circuitstats.h \
src/or/circuituse.h \
src/or/circuit_st.h \
+ src/or/cached_dir_st.h \
src/or/command.h \
src/or/config.h \
src/or/confparse.h \
diff --git a/src/or/or.h b/src/or/or.h
index 9668760ccc..958c1e2bb5 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -1384,19 +1384,7 @@ typedef struct addr_policy_t {
uint16_t prt_max; /**< Highest port number to accept/reject. */
} addr_policy_t;
-/** A cached_dir_t represents a cacheable directory object, along with its
- * compressed form. */
-typedef struct cached_dir_t {
- char *dir; /**< Contents of this object, NUL-terminated. */
- char *dir_compressed; /**< Compressed contents of this object. */
- size_t dir_len; /**< Length of <b>dir</b> (not counting its NUL). */
- size_t dir_compressed_len; /**< Length of <b>dir_compressed</b>. */
- time_t published; /**< When was this object published. */
- common_digests_t digests; /**< Digests of this object (networkstatus only) */
- /** Sha3 digest (also ns only) */
- uint8_t digest_sha3_as_signed[DIGEST256_LEN];
- int refcnt; /**< Reference count for this cached_dir_t. */
-} cached_dir_t;
+typedef struct cached_dir_t cached_dir_t;
/** Enum used to remember where a signed_descriptor_t is stored and how to
* manage the memory for signed_descriptor_body. */