Extract crypt_path_reference_t into its own header.

This commit is contained in:
Nick Mathewson 2018-06-15 11:57:48 -04:00
parent b3f2c682b7
commit c846b0e486
5 changed files with 27 additions and 12 deletions

View File

@ -92,6 +92,7 @@
#include "ht.h"
#include "crypt_path_reference_st.h"
#include "dir_connection_st.h"
#include "edge_connection_st.h"
#include "or_circuit_st.h"

View File

@ -0,0 +1,23 @@
/* 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 CRYPT_PATH_REFERENCE_ST_H
#define CRYPT_PATH_REFERENCE_ST_H
/** A reference-counted pointer to a crypt_path_t, used only to share
* the final rendezvous cpath to be used on a service-side rendezvous
* circuit among multiple circuits built in parallel to the same
* destination rendezvous point. */
struct crypt_path_reference_t {
/** The reference count. */
unsigned int refcount;
/** The pointer. Set to NULL when the crypt_path_t is put into use
* on an opened rendezvous circuit. */
crypt_path_t *cpath;
};
#endif

View File

@ -207,6 +207,7 @@ ORHEADERS = \
src/or/control_connection_st.h \
src/or/control.h \
src/or/crypt_path_st.h \
src/or/crypt_path_reference_st.h \
src/or/cpuworker.h \
src/or/directory.h \
src/or/dirserv.h \

View File

@ -2280,18 +2280,7 @@ typedef struct {
typedef struct relay_crypto_t relay_crypto_t;
typedef struct crypt_path_t crypt_path_t;
/** A reference-counted pointer to a crypt_path_t, used only to share
* the final rendezvous cpath to be used on a service-side rendezvous
* circuit among multiple circuits built in parallel to the same
* destination rendezvous point. */
typedef struct {
/** The reference count. */
unsigned int refcount;
/** The pointer. Set to NULL when the crypt_path_t is put into use
* on an opened rendezvous circuit. */
crypt_path_t *cpath;
} crypt_path_reference_t;
typedef struct crypt_path_reference_t crypt_path_reference_t;
#define CPATH_KEY_MATERIAL_LEN (20*2+16*2)

View File

@ -37,6 +37,7 @@
#include "routerset.h"
#include "crypt_path_st.h"
#include "crypt_path_reference_st.h"
#include "edge_connection_st.h"
#include "origin_circuit_st.h"