Browse Source

Move extend_info_t into its own header.

Nick Mathewson 5 years ago
parent
commit
3191ba389d

+ 1 - 0
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"

+ 1 - 0
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"

+ 1 - 0
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);

+ 1 - 0
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"

+ 1 - 0
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"
 

+ 1 - 0
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"

+ 1 - 0
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"

+ 28 - 0
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
+

+ 1 - 0
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. */

+ 2 - 0
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"

+ 1 - 0
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"

+ 1 - 0
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				\

+ 1 - 0
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

+ 1 - 18
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

+ 1 - 0
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"

+ 1 - 0
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"
 

+ 1 - 0
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"

+ 1 - 0
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"

+ 1 - 0
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"

+ 1 - 0
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"

+ 1 - 0
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"

+ 1 - 0
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"

+ 1 - 0
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"
 

+ 1 - 0
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"

+ 2 - 0
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 */

+ 1 - 0
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);

+ 1 - 0
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"

+ 1 - 0
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"

+ 1 - 0
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"