Procházet zdrojové kódy

Extract crypt_path_reference_t into its own header.

Nick Mathewson před 6 roky
rodič
revize
c846b0e486
5 změnil soubory, kde provedl 27 přidání a 12 odebrání
  1. 1 0
      src/or/circuitlist.c
  2. 23 0
      src/or/crypt_path_reference_st.h
  3. 1 0
      src/or/include.am
  4. 1 12
      src/or/or.h
  5. 1 0
      src/or/rendservice.c

+ 1 - 0
src/or/circuitlist.c

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

+ 23 - 0
src/or/crypt_path_reference_st.h

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

+ 1 - 0
src/or/include.am

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

+ 1 - 12
src/or/or.h

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

+ 1 - 0
src/or/rendservice.c

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