Move hsdir_index_t into its own header.

This commit is contained in:
Nick Mathewson 2018-06-15 15:41:27 -04:00
parent 3191ba389d
commit 7dbe504f3e
4 changed files with 28 additions and 12 deletions

24
src/or/hsdir_index_st.h Normal file
View File

@ -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

View File

@ -252,6 +252,7 @@ ORHEADERS = \
src/or/hs_ntor.h \ src/or/hs_ntor.h \
src/or/hs_stats.h \ src/or/hs_stats.h \
src/or/hs_service.h \ src/or/hs_service.h \
src/or/hsdir_index_st.h \
src/or/keypin.h \ src/or/keypin.h \
src/or/listener_connection_st.h \ src/or/listener_connection_st.h \
src/or/main.h \ src/or/main.h \

View File

@ -7,6 +7,8 @@
#ifndef NODE_ST_H #ifndef NODE_ST_H
#define NODE_ST_H #define NODE_ST_H
#include "hsdir_index_st.h"
/** A node_t represents a Tor router. /** A node_t represents a Tor router.
* *
* Specifically, a node_t is a Tor router as we are using it: a router that * Specifically, a node_t is a Tor router as we are using it: a router that

View File

@ -899,18 +899,7 @@ struct hs_ident_edge_conn_t;
struct hs_ident_dir_conn_t; struct hs_ident_dir_conn_t;
struct hs_ident_circuit_t; struct hs_ident_circuit_t;
/* Hidden service directory index used in a node_t which is set once we set typedef struct hsdir_index_t hsdir_index_t;
* 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;
/** Time interval for tracking replays of DH public keys received in /** Time interval for tracking replays of DH public keys received in
* INTRODUCE2 cells. Used only to avoid launching multiple * INTRODUCE2 cells. Used only to avoid launching multiple