mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-25 07:07:52 +01:00
Extract cached_dir_t into a new header.
This commit is contained in:
parent
f85d731e3a
commit
958df2829a
7 changed files with 31 additions and 13 deletions
25
src/or/cached_dir_st.h
Normal file
25
src/or/cached_dir_st.h
Normal file
|
@ -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
|
||||
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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 \
|
||||
|
|
14
src/or/or.h
14
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. */
|
||||
|
|
Loading…
Add table
Reference in a new issue