[tor-commits] [tor/master] Move extend_info_t into its own header.

nickm at torproject.org nickm at torproject.org
Mon Jun 18 18:18:43 UTC 2018


commit 3191ba389d12146b786ffd8af842a80e58c8c802
Author: Nick Mathewson <nickm at torproject.org>
Date:   Fri Jun 15 15:37:05 2018 -0400

    Move extend_info_t into its own header.
---
 src/or/bridges.c             |  1 +
 src/or/channeltls.c          |  1 +
 src/or/circpathbias.c        |  1 +
 src/or/circuitbuild.c        |  1 +
 src/or/circuitlist.c         |  1 +
 src/or/circuituse.c          |  1 +
 src/or/connection_edge.c     |  1 +
 src/or/extend_info_st.h      | 28 ++++++++++++++++++++++++++++
 src/or/hs_client.c           |  1 +
 src/or/hs_descriptor.c       |  2 ++
 src/or/hs_service.c          |  1 +
 src/or/include.am            |  1 +
 src/or/onion.c               |  1 +
 src/or/or.h                  | 19 +------------------
 src/or/relay.c               |  1 +
 src/or/rendcache.c           |  1 +
 src/or/rendclient.c          |  1 +
 src/or/rendcommon.c          |  1 +
 src/or/rendservice.c         |  1 +
 src/or/router.c              |  1 +
 src/or/routerparse.c         |  1 +
 src/or/routerset.c           |  1 +
 src/test/rend_test_helpers.c |  1 +
 src/test/test.c              |  1 +
 src/test/test_circuitbuild.c |  2 ++
 src/test/test_circuitstats.c |  1 +
 src/test/test_hs_client.c    |  1 +
 src/test/test_rendcache.c    |  1 +
 src/test/test_routerset.c    |  1 +
 29 files changed, 58 insertions(+), 18 deletions(-)

diff --git a/src/or/bridges.c b/src/or/bridges.c
index 013c45cd5..793f292a5 100644
--- a/src/or/bridges.c
+++ b/src/or/bridges.c
@@ -27,6 +27,7 @@
 #include "routerset.h"
 #include "transports.h"
 
+#include "extend_info_st.h"
 #include "node_st.h"
 #include "routerinfo_st.h"
 #include "routerstatus_st.h"
diff --git a/src/or/channeltls.c b/src/or/channeltls.c
index e2b6cabd4..c345364cd 100644
--- a/src/or/channeltls.c
+++ b/src/or/channeltls.c
@@ -62,6 +62,7 @@
 
 #include "cell_st.h"
 #include "cell_queue_st.h"
+#include "extend_info_st.h"
 #include "or_connection_st.h"
 #include "or_handshake_certs_st.h"
 #include "or_handshake_state_st.h"
diff --git a/src/or/circpathbias.c b/src/or/circpathbias.c
index a36d67526..6586fe447 100644
--- a/src/or/circpathbias.c
+++ b/src/or/circpathbias.c
@@ -38,6 +38,7 @@
 #include "cell_st.h"
 #include "cpath_build_state_st.h"
 #include "crypt_path_st.h"
+#include "extend_info_st.h"
 #include "origin_circuit_st.h"
 
 static void pathbias_count_successful_close(origin_circuit_t *circ);
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 41afb7543..dfe293d4e 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -68,6 +68,7 @@
 #include "cell_st.h"
 #include "cpath_build_state_st.h"
 #include "entry_connection_st.h"
+#include "extend_info_st.h"
 #include "node_st.h"
 #include "or_circuit_st.h"
 #include "origin_circuit_st.h"
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
index 46974aea4..95463fde3 100644
--- a/src/or/circuitlist.c
+++ b/src/or/circuitlist.c
@@ -96,6 +96,7 @@
 #include "crypt_path_reference_st.h"
 #include "dir_connection_st.h"
 #include "edge_connection_st.h"
+#include "extend_info_st.h"
 #include "or_circuit_st.h"
 #include "origin_circuit_st.h"
 
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index 370e2c0b7..60ffe95b1 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -60,6 +60,7 @@
 #include "cpath_build_state_st.h"
 #include "dir_connection_st.h"
 #include "entry_connection_st.h"
+#include "extend_info_st.h"
 #include "or_circuit_st.h"
 #include "origin_circuit_st.h"
 #include "socks_request_st.h"
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index 4f1b5d2d5..7ceb97e7c 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -101,6 +101,7 @@
 #include "cpath_build_state_st.h"
 #include "dir_connection_st.h"
 #include "entry_connection_st.h"
+#include "extend_info_st.h"
 #include "node_st.h"
 #include "or_circuit_st.h"
 #include "origin_circuit_st.h"
diff --git a/src/or/extend_info_st.h b/src/or/extend_info_st.h
new file mode 100644
index 000000000..42c638d6d
--- /dev/null
+++ b/src/or/extend_info_st.h
@@ -0,0 +1,28 @@
+/* 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 EXTEND_INFO_ST_H
+#define EXTEND_INFO_ST_H
+
+/** Information on router used when extending a circuit. We don't need a
+ * full routerinfo_t to extend: we only need addr:port:keyid to build an OR
+ * connection, and onion_key to create the onionskin. Note that for onehop
+ * general-purpose tunnels, the onion_key is NULL. */
+struct extend_info_t {
+  char nickname[MAX_HEX_NICKNAME_LEN+1]; /**< This router's nickname for
+                                          * display. */
+  /** Hash of this router's RSA identity key. */
+  char identity_digest[DIGEST_LEN];
+  /** Ed25519 identity for this router, if any. */
+  ed25519_public_key_t ed_identity;
+  uint16_t port; /**< OR port. */
+  tor_addr_t addr; /**< IP address. */
+  crypto_pk_t *onion_key; /**< Current onionskin key. */
+  curve25519_public_key_t curve25519_onion_key;
+};
+
+#endif
+
diff --git a/src/or/hs_client.c b/src/or/hs_client.c
index 18276bfb8..2237699bc 100644
--- a/src/or/hs_client.c
+++ b/src/or/hs_client.c
@@ -38,6 +38,7 @@
 #include "cpath_build_state_st.h"
 #include "dir_connection_st.h"
 #include "entry_connection_st.h"
+#include "extend_info_st.h"
 #include "origin_circuit_st.h"
 
 /* Return a human-readable string for the client fetch status code. */
diff --git a/src/or/hs_descriptor.c b/src/or/hs_descriptor.c
index 096122392..bda4dd64b 100644
--- a/src/or/hs_descriptor.c
+++ b/src/or/hs_descriptor.c
@@ -67,6 +67,8 @@
 #include "hs_config.h"
 #include "torcert.h" /* tor_cert_encode_ed22519() */
 
+#include "extend_info_st.h"
+
 /* Constant string value used for the descriptor format. */
 #define str_hs_desc "hs-descriptor"
 #define str_desc_cert "descriptor-signing-key-cert"
diff --git a/src/or/hs_service.c b/src/or/hs_service.c
index ef809a69f..46fb3bf68 100644
--- a/src/or/hs_service.c
+++ b/src/or/hs_service.c
@@ -41,6 +41,7 @@
 
 #include "dir_connection_st.h"
 #include "edge_connection_st.h"
+#include "extend_info_st.h"
 #include "networkstatus_st.h"
 #include "node_st.h"
 #include "origin_circuit_st.h"
diff --git a/src/or/include.am b/src/or/include.am
index ec8e27556..06e61e00d 100644
--- a/src/or/include.am
+++ b/src/or/include.am
@@ -230,6 +230,7 @@ ORHEADERS = \
 	src/or/entry_connection_st.h			\
 	src/or/entry_port_cfg_st.h			\
 	src/or/ext_orport.h				\
+	src/or/extend_info_st.h				\
 	src/or/extrainfo_st.h				\
 	src/or/fallback_dirs.inc			\
 	src/or/fp_pair.h				\
diff --git a/src/or/onion.c b/src/or/onion.c
index ac2f40a55..c84cb13ad 100644
--- a/src/or/onion.c
+++ b/src/or/onion.c
@@ -78,6 +78,7 @@
 #include "router.h"
 
 #include "cell_st.h"
+#include "extend_info_st.h"
 #include "or_circuit_st.h"
 
 // trunnel
diff --git a/src/or/or.h b/src/or/or.h
index 66c863a82..b164cf0e7 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -1502,24 +1502,7 @@ typedef enum store_type_t {
 
 typedef struct desc_store_t desc_store_t;
 typedef struct routerlist_t routerlist_t;
-
-/** Information on router used when extending a circuit. We don't need a
- * full routerinfo_t to extend: we only need addr:port:keyid to build an OR
- * connection, and onion_key to create the onionskin. Note that for onehop
- * general-purpose tunnels, the onion_key is NULL. */
-typedef struct extend_info_t {
-  char nickname[MAX_HEX_NICKNAME_LEN+1]; /**< This router's nickname for
-                                          * display. */
-  /** Hash of this router's RSA identity key. */
-  char identity_digest[DIGEST_LEN];
-  /** Ed25519 identity for this router, if any. */
-  ed25519_public_key_t ed_identity;
-  uint16_t port; /**< OR port. */
-  tor_addr_t addr; /**< IP address. */
-  crypto_pk_t *onion_key; /**< Current onionskin key. */
-  curve25519_public_key_t curve25519_onion_key;
-} extend_info_t;
-
+typedef struct extend_info_t extend_info_t;
 typedef struct authority_cert_t authority_cert_t;
 
 /** Bitfield enum type listing types of information that directory authorities
diff --git a/src/or/relay.c b/src/or/relay.c
index 62c9204db..6af7c8d1d 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -88,6 +88,7 @@
 #include "dir_connection_st.h"
 #include "destroy_cell_queue_st.h"
 #include "entry_connection_st.h"
+#include "extend_info_st.h"
 #include "or_circuit_st.h"
 #include "origin_circuit_st.h"
 #include "routerinfo_st.h"
diff --git a/src/or/rendcache.c b/src/or/rendcache.c
index 093cbe7ce..196ae9ad1 100644
--- a/src/or/rendcache.c
+++ b/src/or/rendcache.c
@@ -15,6 +15,7 @@
 #include "routerparse.h"
 #include "rendcommon.h"
 
+#include "extend_info_st.h"
 #include "rend_intro_point_st.h"
 #include "rend_service_descriptor_st.h"
 
diff --git a/src/or/rendclient.c b/src/or/rendclient.c
index 323612785..4154030b8 100644
--- a/src/or/rendclient.c
+++ b/src/or/rendclient.c
@@ -37,6 +37,7 @@
 #include "crypt_path_st.h"
 #include "dir_connection_st.h"
 #include "entry_connection_st.h"
+#include "extend_info_st.h"
 #include "origin_circuit_st.h"
 #include "rend_intro_point_st.h"
 #include "rend_service_descriptor_st.h"
diff --git a/src/or/rendcommon.c b/src/or/rendcommon.c
index 904969946..80cb79846 100644
--- a/src/or/rendcommon.c
+++ b/src/or/rendcommon.c
@@ -33,6 +33,7 @@
 
 #include "cpath_build_state_st.h"
 #include "crypt_path_st.h"
+#include "extend_info_st.h"
 #include "networkstatus_st.h"
 #include "origin_circuit_st.h"
 #include "rend_encoded_v2_service_descriptor_st.h"
diff --git a/src/or/rendservice.c b/src/or/rendservice.c
index 170d78147..e207707e9 100644
--- a/src/or/rendservice.c
+++ b/src/or/rendservice.c
@@ -40,6 +40,7 @@
 #include "crypt_path_st.h"
 #include "crypt_path_reference_st.h"
 #include "edge_connection_st.h"
+#include "extend_info_st.h"
 #include "networkstatus_st.h"
 #include "origin_circuit_st.h"
 #include "rend_authorized_client_st.h"
diff --git a/src/or/router.c b/src/or/router.c
index ddbfb0313..614860f61 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -43,6 +43,7 @@
 #include "crypt_path_st.h"
 #include "dir_connection_st.h"
 #include "dir_server_st.h"
+#include "extend_info_st.h"
 #include "extrainfo_st.h"
 #include "node_st.h"
 #include "origin_circuit_st.h"
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index 040745f65..31c545edf 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -83,6 +83,7 @@
 
 #include "authority_cert_st.h"
 #include "document_signature_st.h"
+#include "extend_info_st.h"
 #include "extrainfo_st.h"
 #include "microdesc_st.h"
 #include "networkstatus_st.h"
diff --git a/src/or/routerset.c b/src/or/routerset.c
index 415fa0ce7..6da1c201b 100644
--- a/src/or/routerset.c
+++ b/src/or/routerset.c
@@ -36,6 +36,7 @@
 #include "routerparse.h"
 #include "routerset.h"
 
+#include "extend_info_st.h"
 #include "node_st.h"
 #include "routerinfo_st.h"
 #include "routerstatus_st.h"
diff --git a/src/test/rend_test_helpers.c b/src/test/rend_test_helpers.c
index fb2e4cf50..ec252c39b 100644
--- a/src/test/rend_test_helpers.c
+++ b/src/test/rend_test_helpers.c
@@ -7,6 +7,7 @@
 #include "rendcommon.h"
 #include "rend_test_helpers.h"
 
+#include "extend_info_st.h"
 #include "rend_intro_point_st.h"
 #include "rend_service_descriptor_st.h"
 
diff --git a/src/test/test.c b/src/test/test.c
index 871498aa0..14456d866 100644
--- a/src/test/test.c
+++ b/src/test/test.c
@@ -62,6 +62,7 @@ double fabs(double x);
 #include "statefile.h"
 #include "crypto_curve25519.h"
 
+#include "extend_info_st.h"
 #include "or_circuit_st.h"
 #include "rend_encoded_v2_service_descriptor_st.h"
 #include "rend_intro_point_st.h"
diff --git a/src/test/test_circuitbuild.c b/src/test/test_circuitbuild.c
index a5282df69..b09f7bf55 100644
--- a/src/test/test_circuitbuild.c
+++ b/src/test/test_circuitbuild.c
@@ -12,6 +12,8 @@
 #include "config.h"
 #include "circuitbuild.h"
 
+#include "extend_info_st.h"
+
 /* Dummy nodes smartlist for testing */
 static smartlist_t dummy_nodes;
 /* Dummy exit extend_info for testing */
diff --git a/src/test/test_circuitstats.c b/src/test/test_circuitstats.c
index 9f6f4626d..b8056e0d1 100644
--- a/src/test/test_circuitstats.c
+++ b/src/test/test_circuitstats.c
@@ -19,6 +19,7 @@
 
 #include "cpath_build_state_st.h"
 #include "crypt_path_st.h"
+#include "extend_info_st.h"
 #include "origin_circuit_st.h"
 
 void test_circuitstats_timeout(void *arg);
diff --git a/src/test/test_hs_client.c b/src/test/test_hs_client.c
index ca87d5e92..64c098dbb 100644
--- a/src/test/test_hs_client.c
+++ b/src/test/test_hs_client.c
@@ -41,6 +41,7 @@
 #include "crypt_path_st.h"
 #include "dir_connection_st.h"
 #include "entry_connection_st.h"
+#include "extend_info_st.h"
 #include "networkstatus_st.h"
 #include "origin_circuit_st.h"
 #include "socks_request_st.h"
diff --git a/src/test/test_rendcache.c b/src/test/test_rendcache.c
index 22af3473b..6bc803828 100644
--- a/src/test/test_rendcache.c
+++ b/src/test/test_rendcache.c
@@ -12,6 +12,7 @@
 #include "config.h"
 #include "hs_common.h"
 
+#include "extend_info_st.h"
 #include "rend_encoded_v2_service_descriptor_st.h"
 #include "rend_intro_point_st.h"
 #include "rend_service_descriptor_st.h"
diff --git a/src/test/test_routerset.c b/src/test/test_routerset.c
index 004b88ac8..11a1ff2af 100644
--- a/src/test/test_routerset.c
+++ b/src/test/test_routerset.c
@@ -10,6 +10,7 @@
 #include "policies.h"
 #include "nodelist.h"
 
+#include "extend_info_st.h"
 #include "node_st.h"
 #include "routerinfo_st.h"
 #include "routerstatus_st.h"





More information about the tor-commits mailing list