Browse Source

Move hsdir_index_t into its own header.

Nick Mathewson 5 years ago
parent
commit
7dbe504f3e
4 changed files with 28 additions and 12 deletions
  1. 24 0
      src/or/hsdir_index_st.h
  2. 1 0
      src/or/include.am
  3. 2 0
      src/or/node_st.h
  4. 1 12
      src/or/or.h

+ 24 - 0
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
+

+ 1 - 0
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					\

+ 2 - 0
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

+ 1 - 12
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