[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] Move hsdir_index_t into its own header.



commit 7dbe504f3e527ed5c266a43380eeec1a82914cc2
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Fri Jun 15 15:41:27 2018 -0400

    Move hsdir_index_t into its own header.
---
 src/or/hsdir_index_st.h | 24 ++++++++++++++++++++++++
 src/or/include.am       |  1 +
 src/or/node_st.h        |  2 ++
 src/or/or.h             | 13 +------------
 4 files changed, 28 insertions(+), 12 deletions(-)

diff --git a/src/or/hsdir_index_st.h b/src/or/hsdir_index_st.h
new file mode 100644
index 000000000..9d9ce66bd
--- /dev/null
+++ b/src/or/hsdir_index_st.h
@@ -0,0 +1,24 @@
+/* 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 HSDIR_INDEX_ST_H
+#define HSDIR_INDEX_ST_H
+
+/* Hidden service directory index used in a node_t which is set once we set
+ * the consensus. */
+struct hsdir_index_t {
+  /* HSDir index to use when fetching a descriptor. */
+  uint8_t fetch[DIGEST256_LEN];
+
+  /* HSDir index used by services to store their first and second
+   * descriptor. The first descriptor is chronologically older than the second
+   * one and uses older TP and SRV values. */
+  uint8_t store_first[DIGEST256_LEN];
+  uint8_t store_second[DIGEST256_LEN];
+};
+
+#endif
+
diff --git a/src/or/include.am b/src/or/include.am
index 06e61e00d..af525f35c 100644
--- a/src/or/include.am
+++ b/src/or/include.am
@@ -252,6 +252,7 @@ ORHEADERS = \
 	src/or/hs_ntor.h				\
 	src/or/hs_stats.h				\
 	src/or/hs_service.h				\
+	src/or/hsdir_index_st.h				\
 	src/or/keypin.h					\
 	src/or/listener_connection_st.h			\
 	src/or/main.h					\
diff --git a/src/or/node_st.h b/src/or/node_st.h
index 511e23ad1..43206f662 100644
--- a/src/or/node_st.h
+++ b/src/or/node_st.h
@@ -7,6 +7,8 @@
 #ifndef NODE_ST_H
 #define NODE_ST_H
 
+#include "hsdir_index_st.h"
+
 /** A node_t represents a Tor router.
  *
  * Specifically, a node_t is a Tor router as we are using it: a router that
diff --git a/src/or/or.h b/src/or/or.h
index b164cf0e7..7d4d963e0 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -899,18 +899,7 @@ struct hs_ident_edge_conn_t;
 struct hs_ident_dir_conn_t;
 struct hs_ident_circuit_t;
 
-/* Hidden service directory index used in a node_t which is set once we set
- * the consensus. */
-typedef struct hsdir_index_t {
-  /* HSDir index to use when fetching a descriptor. */
-  uint8_t fetch[DIGEST256_LEN];
-
-  /* HSDir index used by services to store their first and second
-   * descriptor. The first descriptor is chronologically older than the second
-   * one and uses older TP and SRV values. */
-  uint8_t store_first[DIGEST256_LEN];
-  uint8_t store_second[DIGEST256_LEN];
-} hsdir_index_t;
+typedef struct hsdir_index_t hsdir_index_t;
 
 /** Time interval for tracking replays of DH public keys received in
  * INTRODUCE2 cells.  Used only to avoid launching multiple



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits