]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Extract rend_service_descriptor_t into its own header.
authorNick Mathewson <nickm@torproject.org>
Fri, 15 Jun 2018 16:18:17 +0000 (12:18 -0400)
committerNick Mathewson <nickm@torproject.org>
Fri, 15 Jun 2018 16:18:17 +0000 (12:18 -0400)
14 files changed:
src/or/control.c
src/or/directory.c
src/or/include.am
src/or/or.h
src/or/rend_service_descriptor_st.h [new file with mode: 0644]
src/or/rendcache.c
src/or/rendclient.c
src/or/rendcommon.c
src/or/rendservice.c
src/or/routerparse.c
src/test/fuzz/fuzz_iptsv2.c
src/test/rend_test_helpers.c
src/test/test.c
src/test/test_rendcache.c

index 972462e38aaf438140afa8526652f43e4215f046..401135ca82477b17363ee4d2cf959f242a939e19 100644 (file)
@@ -87,6 +87,7 @@
 #include "or_connection_st.h"
 #include "or_circuit_st.h"
 #include "origin_circuit_st.h"
+#include "rend_service_descriptor_st.h"
 
 #ifndef _WIN32
 #include <pwd.h>
index 65aaaa38a6deeeec107cc3e1332eeacfc70d66b5..720ef975baf41ce7119888cf05cfbb97e7bbaf11 100644 (file)
@@ -56,6 +56,7 @@
 #include "dir_connection_st.h"
 #include "dir_server_st.h"
 #include "entry_connection_st.h"
+#include "rend_service_descriptor_st.h"
 
 /**
  * \file directory.c
index 618ffacd03bf1d033b524968e2bc7976bfdf2055..883366fc1c13fe0aa591e538f337c60dba423425 100644 (file)
@@ -279,6 +279,7 @@ ORHEADERS = \
        src/or/rendcommon.h                             \
        src/or/rendmid.h                                \
        src/or/rendservice.h                            \
+       src/or/rend_service_descriptor_st.h             \
        src/or/rephist.h                                \
        src/or/replaycache.h                            \
        src/or/router.h                                 \
index b67896d2a5a3eca924ad0363b64b7307c1658793..e66bad5ab35e6a314928e6b6b4fdd789ddc9dcd1 100644 (file)
@@ -4145,28 +4145,7 @@ typedef struct rend_intro_point_t {
   unsigned int circuit_established:1;
 } rend_intro_point_t;
 
-#define REND_PROTOCOL_VERSION_BITMASK_WIDTH 16
-
-/** Information used to connect to a hidden service.  Used on both the
- * service side and the client side. */
-typedef struct rend_service_descriptor_t {
-  crypto_pk_t *pk; /**< This service's public key. */
-  int version; /**< Version of the descriptor format: 0 or 2. */
-  time_t timestamp; /**< Time when the descriptor was generated. */
-  /** Bitmask: which introduce/rendezvous protocols are supported?
-   * (We allow bits '0', '1', '2' and '3' to be set.) */
-  unsigned protocols : REND_PROTOCOL_VERSION_BITMASK_WIDTH;
-  /** List of the service's introduction points.  Elements are removed if
-   * introduction attempts fail. */
-  smartlist_t *intro_nodes;
-  /** Has descriptor been uploaded to all hidden service directories? */
-  int all_uploads_performed;
-  /** List of hidden service directories to which an upload request for
-   * this descriptor could be sent. Smartlist exists only when at least one
-   * of the previous upload requests failed (otherwise it's not important
-   * to know which uploads succeeded and which not). */
-  smartlist_t *successful_uploads;
-} rend_service_descriptor_t;
+typedef struct rend_service_descriptor_t rend_service_descriptor_t;
 
 /********************************* routerlist.c ***************************/
 
diff --git a/src/or/rend_service_descriptor_st.h b/src/or/rend_service_descriptor_st.h
new file mode 100644 (file)
index 0000000..bd6d55b
--- /dev/null
@@ -0,0 +1,34 @@
+/* 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 REND_SERVICE_DESCRIPTOR_ST_H
+#define REND_SERVICE_DESCRIPTOR_ST_H
+
+#define REND_PROTOCOL_VERSION_BITMASK_WIDTH 16
+
+/** Information used to connect to a hidden service.  Used on both the
+ * service side and the client side. */
+struct rend_service_descriptor_t {
+  crypto_pk_t *pk; /**< This service's public key. */
+  int version; /**< Version of the descriptor format: 0 or 2. */
+  time_t timestamp; /**< Time when the descriptor was generated. */
+  /** Bitmask: which introduce/rendezvous protocols are supported?
+   * (We allow bits '0', '1', '2' and '3' to be set.) */
+  unsigned protocols : REND_PROTOCOL_VERSION_BITMASK_WIDTH;
+  /** List of the service's introduction points.  Elements are removed if
+   * introduction attempts fail. */
+  smartlist_t *intro_nodes;
+  /** Has descriptor been uploaded to all hidden service directories? */
+  int all_uploads_performed;
+  /** List of hidden service directories to which an upload request for
+   * this descriptor could be sent. Smartlist exists only when at least one
+   * of the previous upload requests failed (otherwise it's not important
+   * to know which uploads succeeded and which not). */
+  smartlist_t *successful_uploads;
+};
+
+#endif
+
index d27e1c293f8ad370fbef6cc0fe8dfa89874e27dd..6dd49ee9ccd0cdb26cc1474f6aedd7119c0e1918 100644 (file)
@@ -15,6 +15,8 @@
 #include "routerparse.h"
 #include "rendcommon.h"
 
+#include "rend_service_descriptor_st.h"
+
 /** Map from service id (as generated by rend_get_service_id) to
  * rend_cache_entry_t. */
 STATIC strmap_t *rend_cache = NULL;
index c55f63c33f08ef4786201a218f9f6432eec39be6..1d12e1829898ad208b847c8afdcdb7fa07f5661f 100644 (file)
@@ -38,6 +38,7 @@
 #include "dir_connection_st.h"
 #include "entry_connection_st.h"
 #include "origin_circuit_st.h"
+#include "rend_service_descriptor_st.h"
 
 static extend_info_t *rend_client_get_random_intro_impl(
                           const rend_cache_entry_t *rend_query,
index 719a1537c9a67c565673c4bb66caaff4e0d06d0a..b2d4b0949ad6001548b03ab9b1922d8e0cec6e63 100644 (file)
@@ -34,6 +34,7 @@
 #include "cpath_build_state_st.h"
 #include "crypt_path_st.h"
 #include "origin_circuit_st.h"
+#include "rend_service_descriptor_st.h"
 
 /** Return 0 if one and two are the same service ids, else -1 or 1 */
 int
index ef46ff6ced8fdb2e2e44516a14105da8f7f4f94d..e27e8c4fb49377ba4713e03ba119d30814db4061 100644 (file)
@@ -41,6 +41,7 @@
 #include "crypt_path_reference_st.h"
 #include "edge_connection_st.h"
 #include "origin_circuit_st.h"
+#include "rend_service_descriptor_st.h"
 
 struct rend_service_t;
 static origin_circuit_t *find_intro_circuit(rend_intro_point_t *intro,
index 06a37904dfce9b72a8400f905731b05951364366..af11bc3d5cee32d5b5bfc8ab2cf1f7bd64bee04d 100644 (file)
 #include "torcert.h"
 #include "voting_schedule.h"
 
-#undef log
-#include <math.h>
-
 #include "dirauth/dirvote.h"
 
+#include "rend_service_descriptor_st.h"
 #include "tor_version_st.h"
 
+#undef log
+#include <math.h>
+
 /****************************************************************************/
 
 /** List of tokens recognized in router descriptors */
index 4abde0c16dfc3e30b4a3397eeb3014df14390d78..db99f62dc9109278d1e3225163d96499a9c90df6 100644 (file)
@@ -4,6 +4,9 @@
 #include "or.h"
 #include "routerparse.h"
 #include "rendcommon.h"
+
+#include "rend_service_descriptor_st.h"
+
 #include "fuzzing.h"
 
 static void
index 9ac3894b0b18c2ff1e4977053fd24b5647877dcf..177935edfb821c4766d78d94ceafe0b23ec0bfd0 100644 (file)
@@ -7,6 +7,8 @@
 #include "rendcommon.h"
 #include "rend_test_helpers.h"
 
+#include "rend_service_descriptor_st.h"
+
 void
 generate_desc(int time_diff, rend_encoded_v2_service_descriptor_t **desc,
               char **service_id, int intro_points)
index b92dd3c8a0c9729d23e602b183135417b21cd740..0408615605fee1777201bca8a8ceb510917900af 100644 (file)
@@ -63,6 +63,7 @@ double fabs(double x);
 #include "crypto_curve25519.h"
 
 #include "or_circuit_st.h"
+#include "rend_service_descriptor_st.h"
 
 /** Run unit tests for the onion handshake code. */
 static void
index 9f6cfc4a22094e2c4b8913d6cfdd25fc5d1b6071..f1e94eb0216caf739bc9f8f2631f38f0a3e6481d 100644 (file)
@@ -11,6 +11,9 @@
 #include "routerlist.h"
 #include "config.h"
 #include "hs_common.h"
+
+#include "rend_service_descriptor_st.h"
+
 #include "rend_test_helpers.h"
 #include "log_test_helpers.h"