Move extend_info_t into its own header.

This commit is contained in:
Nick Mathewson 2018-06-15 15:37:05 -04:00
parent fde868ffe3
commit 3191ba389d
29 changed files with 58 additions and 18 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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
src/or/extend_info_st.h Normal file
View File

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

View File

@ -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. */

View File

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

View File

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

View File

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

View File

@ -78,6 +78,7 @@
#include "router.h"
#include "cell_st.h"
#include "extend_info_st.h"
#include "or_circuit_st.h"
// trunnel

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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 */

View File

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

View File

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

View File

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

View File

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