#include "routerparse.h"
#include "workqueue.h"
+#include "networkstatus_st.h"
#include "networkstatus_voter_info_st.h"
/**
#include "control_connection_st.h"
#include "cpath_build_state_st.h"
#include "entry_connection_st.h"
+#include "networkstatus_st.h"
#include "node_st.h"
#include "or_connection_st.h"
#include "or_circuit_st.h"
#include "dircollate.h"
#include "dirvote.h"
+#include "networkstatus_st.h"
#include "vote_routerstatus_st.h"
static void dircollator_collate_by_ed25519(dircollator_t *dc);
#include "dir_server_st.h"
#include "document_signature_st.h"
+#include "networkstatus_st.h"
#include "networkstatus_voter_info_st.h"
#include "node_st.h"
#include "vote_microdesc_hash_st.h"
#include "dirauth/dirvote.h"
#include "dirauth/mode.h"
+#include "networkstatus_st.h"
+
/* String prefix of shared random values in votes/consensuses. */
static const char previous_srv_str[] = "shared-rand-previous-value";
static const char current_srv_str[] = "shared-rand-current-value";
#include "dir_connection_st.h"
#include "dir_server_st.h"
#include "entry_connection_st.h"
+#include "networkstatus_st.h"
#include "node_st.h"
#include "rend_service_descriptor_st.h"
#include "hs_cache.h"
+#include "networkstatus_st.h"
+
static int cached_client_descriptor_has_expired(time_t now,
const hs_cache_client_descriptor_t *cached_desc);
#include "dirauth/shared_random_state.h"
#include "edge_connection_st.h"
+#include "networkstatus_st.h"
#include "node_st.h"
#include "origin_circuit_st.h"
#include "dir_connection_st.h"
#include "edge_connection_st.h"
+#include "networkstatus_st.h"
#include "node_st.h"
#include "origin_circuit_st.h"
src/or/main.h \
src/or/microdesc.h \
src/or/networkstatus.h \
+ src/or/networkstatus_st.h \
+ src/or/networkstatus_sr_info_st.h \
src/or/networkstatus_voter_info_st.h \
src/or/nodelist.h \
src/or/node_st.h \
#include "dirauth/shared_random.h"
#include "entry_connection_st.h"
+#include "networkstatus_st.h"
#include "or_connection_st.h"
#include "port_cfg_st.h"
#include "socks_request_st.h"
#include "routerlist.h"
#include "routerparse.h"
+#include "networkstatus_st.h"
#include "node_st.h"
/** A data structure to hold a bunch of cached microdescriptors. There are
#include "dir_connection_st.h"
#include "dir_server_st.h"
#include "document_signature_st.h"
+#include "networkstatus_st.h"
#include "networkstatus_voter_info_st.h"
#include "node_st.h"
#include "vote_microdesc_hash_st.h"
--- /dev/null
+/* 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 NETWORKSTATUS_SR_INFO_ST_H
+#define NETWORKSTATUS_SR_INFO_ST_H
+
+struct networkstatus_sr_info_t {
+ /* Indicate if the dirauth partitipates in the SR protocol with its vote.
+ * This is tied to the SR flag in the vote. */
+ unsigned int participate:1;
+ /* Both vote and consensus: Current and previous SRV. If list is empty,
+ * this means none were found in either the consensus or vote. */
+ struct sr_srv_t *previous_srv;
+ struct sr_srv_t *current_srv;
+ /* Vote only: List of commitments. */
+ smartlist_t *commits;
+};
+
+#endif
+
--- /dev/null
+/* 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 NETWORKSTATUS_ST_H
+#define NETWORKSTATUS_ST_H
+
+#include "networkstatus_sr_info_st.h"
+
+/** A common structure to hold a v3 network status vote, or a v3 network
+ * status consensus. */
+struct networkstatus_t {
+ networkstatus_type_t type; /**< Vote, consensus, or opinion? */
+ consensus_flavor_t flavor; /**< If a consensus, what kind? */
+ unsigned int has_measured_bws : 1;/**< True iff this networkstatus contains
+ * measured= bandwidth values. */
+
+ time_t published; /**< Vote only: Time when vote was written. */
+ time_t valid_after; /**< Time after which this vote or consensus applies. */
+ time_t fresh_until; /**< Time before which this is the most recent vote or
+ * consensus. */
+ time_t valid_until; /**< Time after which this vote or consensus should not
+ * be used. */
+
+ /** Consensus only: what method was used to produce this consensus? */
+ int consensus_method;
+ /** Vote only: what methods is this voter willing to use? */
+ smartlist_t *supported_methods;
+
+ /** List of 'package' lines describing hashes of downloadable packages */
+ smartlist_t *package_lines;
+
+ /** How long does this vote/consensus claim that authorities take to
+ * distribute their votes to one another? */
+ int vote_seconds;
+ /** How long does this vote/consensus claim that authorities take to
+ * distribute their consensus signatures to one another? */
+ int dist_seconds;
+
+ /** Comma-separated list of recommended client software, or NULL if this
+ * voter has no opinion. */
+ char *client_versions;
+ char *server_versions;
+
+ /** Lists of subprotocol versions which are _recommended_ for relays and
+ * clients, or which are _require_ for relays and clients. Tor shouldn't
+ * make any more network connections if a required protocol is missing.
+ */
+ char *recommended_relay_protocols;
+ char *recommended_client_protocols;
+ char *required_relay_protocols;
+ char *required_client_protocols;
+
+ /** List of flags that this vote/consensus applies to routers. If a flag is
+ * not listed here, the voter has no opinion on what its value should be. */
+ smartlist_t *known_flags;
+
+ /** List of key=value strings for the parameters in this vote or
+ * consensus, sorted by key. */
+ smartlist_t *net_params;
+
+ /** List of key=value strings for the bw weight parameters in the
+ * consensus. */
+ smartlist_t *weight_params;
+
+ /** List of networkstatus_voter_info_t. For a vote, only one element
+ * is included. For a consensus, one element is included for every voter
+ * whose vote contributed to the consensus. */
+ smartlist_t *voters;
+
+ struct authority_cert_t *cert; /**< Vote only: the voter's certificate. */
+
+ /** Digests of this document, as signed. */
+ common_digests_t digests;
+ /** A SHA3-256 digest of the document, not including signatures: used for
+ * consensus diffs */
+ uint8_t digest_sha3_as_signed[DIGEST256_LEN];
+
+ /** List of router statuses, sorted by identity digest. For a vote,
+ * the elements are vote_routerstatus_t; for a consensus, the elements
+ * are routerstatus_t. */
+ smartlist_t *routerstatus_list;
+
+ /** If present, a map from descriptor digest to elements of
+ * routerstatus_list. */
+ digestmap_t *desc_digest_map;
+
+ /** Contains the shared random protocol data from a vote or consensus. */
+ networkstatus_sr_info_t sr_info;
+};
+
+#endif
+
#include "dirauth/mode.h"
#include "dir_server_st.h"
+#include "networkstatus_st.h"
#include "node_st.h"
static void nodelist_drop_node(node_t *node, int remove_from_ht);
typedef struct vote_routerstatus_t vote_routerstatus_t;
typedef struct document_signature_t document_signature_t;
typedef struct networkstatus_voter_info_t networkstatus_voter_info_t;
-
-typedef struct networkstatus_sr_info_t {
- /* Indicate if the dirauth partitipates in the SR protocol with its vote.
- * This is tied to the SR flag in the vote. */
- unsigned int participate:1;
- /* Both vote and consensus: Current and previous SRV. If list is empty,
- * this means none were found in either the consensus or vote. */
- struct sr_srv_t *previous_srv;
- struct sr_srv_t *current_srv;
- /* Vote only: List of commitments. */
- smartlist_t *commits;
-} networkstatus_sr_info_t;
+typedef struct networkstatus_sr_info_t networkstatus_sr_info_t;
/** Enumerates the possible seriousness values of a networkstatus document. */
typedef enum {
/** How many different consensus flavors are there? */
#define N_CONSENSUS_FLAVORS ((int)(FLAV_MICRODESC)+1)
-/** A common structure to hold a v3 network status vote, or a v3 network
- * status consensus. */
-typedef struct networkstatus_t {
- networkstatus_type_t type; /**< Vote, consensus, or opinion? */
- consensus_flavor_t flavor; /**< If a consensus, what kind? */
- unsigned int has_measured_bws : 1;/**< True iff this networkstatus contains
- * measured= bandwidth values. */
-
- time_t published; /**< Vote only: Time when vote was written. */
- time_t valid_after; /**< Time after which this vote or consensus applies. */
- time_t fresh_until; /**< Time before which this is the most recent vote or
- * consensus. */
- time_t valid_until; /**< Time after which this vote or consensus should not
- * be used. */
-
- /** Consensus only: what method was used to produce this consensus? */
- int consensus_method;
- /** Vote only: what methods is this voter willing to use? */
- smartlist_t *supported_methods;
-
- /** List of 'package' lines describing hashes of downloadable packages */
- smartlist_t *package_lines;
-
- /** How long does this vote/consensus claim that authorities take to
- * distribute their votes to one another? */
- int vote_seconds;
- /** How long does this vote/consensus claim that authorities take to
- * distribute their consensus signatures to one another? */
- int dist_seconds;
-
- /** Comma-separated list of recommended client software, or NULL if this
- * voter has no opinion. */
- char *client_versions;
- char *server_versions;
-
- /** Lists of subprotocol versions which are _recommended_ for relays and
- * clients, or which are _require_ for relays and clients. Tor shouldn't
- * make any more network connections if a required protocol is missing.
- */
- char *recommended_relay_protocols;
- char *recommended_client_protocols;
- char *required_relay_protocols;
- char *required_client_protocols;
-
- /** List of flags that this vote/consensus applies to routers. If a flag is
- * not listed here, the voter has no opinion on what its value should be. */
- smartlist_t *known_flags;
-
- /** List of key=value strings for the parameters in this vote or
- * consensus, sorted by key. */
- smartlist_t *net_params;
-
- /** List of key=value strings for the bw weight parameters in the
- * consensus. */
- smartlist_t *weight_params;
-
- /** List of networkstatus_voter_info_t. For a vote, only one element
- * is included. For a consensus, one element is included for every voter
- * whose vote contributed to the consensus. */
- smartlist_t *voters;
-
- struct authority_cert_t *cert; /**< Vote only: the voter's certificate. */
-
- /** Digests of this document, as signed. */
- common_digests_t digests;
- /** A SHA3-256 digest of the document, not including signatures: used for
- * consensus diffs */
- uint8_t digest_sha3_as_signed[DIGEST256_LEN];
-
- /** List of router statuses, sorted by identity digest. For a vote,
- * the elements are vote_routerstatus_t; for a consensus, the elements
- * are routerstatus_t. */
- smartlist_t *routerstatus_list;
-
- /** If present, a map from descriptor digest to elements of
- * routerstatus_list. */
- digestmap_t *desc_digest_map;
-
- /** Contains the shared random protocol data from a vote or consensus. */
- networkstatus_sr_info_t sr_info;
-} networkstatus_t;
+typedef struct networkstatus_t networkstatus_t;
/** A set of signatures for a networkstatus consensus. Unless otherwise
* noted, all fields are as for networkstatus_t. */
#include "cpath_build_state_st.h"
#include "crypt_path_st.h"
+#include "networkstatus_st.h"
#include "origin_circuit_st.h"
#include "rend_encoded_v2_service_descriptor_st.h"
#include "rend_intro_point_st.h"
#include "crypt_path_st.h"
#include "crypt_path_reference_st.h"
#include "edge_connection_st.h"
+#include "networkstatus_st.h"
#include "origin_circuit_st.h"
#include "rend_authorized_client_st.h"
#include "rend_encoded_v2_service_descriptor_st.h"
#include "connection_or.h"
#include "statefile.h"
+#include "networkstatus_st.h"
#include "or_circuit_st.h"
static void bw_arrays_init(void);
#include "dir_connection_st.h"
#include "dir_server_st.h"
#include "document_signature_st.h"
+#include "networkstatus_st.h"
#include "networkstatus_voter_info_st.h"
#include "node_st.h"
#include "vote_routerstatus_st.h"
#include "dirauth/dirvote.h"
#include "document_signature_st.h"
+#include "networkstatus_st.h"
#include "networkstatus_voter_info_st.h"
#include "rend_authorized_client_st.h"
#include "rend_intro_point_st.h"
#include "util.h"
#include "util_format.h"
+#include "networkstatus_st.h"
+
/* Convert a given srv object to a string for the control port. This doesn't
* fail and the srv object MUST be valid. */
static char *
#include "config.h"
#include "networkstatus.h"
+#include "networkstatus_st.h"
+
/* =====
* Vote scheduling
* ===== */
#include "microdesc.h"
#include "networkstatus.h"
+#include "networkstatus_st.h"
#include "vote_routerstatus_st.h"
#include "fuzzing.h"
#include "routerlist.h"
#include "torcert.h"
+#include "networkstatus_st.h"
+
#include "test.h"
static networkstatus_t *dummy_ns = NULL;
#include "scheduler.h"
#include "networkstatus.h"
+#include "networkstatus_st.h"
#include "origin_circuit_st.h"
/* Test suite stuff */
#include "networkstatus.h"
#include "log_test_helpers.h"
+#include "networkstatus_st.h"
#include "or_connection_st.h"
int channelpadding_get_netflow_inactive_timeout_ms(channel_t *chan);
#include "routerparse.h"
#include "workqueue.h"
+#include "networkstatus_st.h"
+
#include "test.h"
#include "log_test_helpers.h"
#include "voting_schedule.h"
#include "document_signature_st.h"
+#include "networkstatus_st.h"
#include "networkstatus_voter_info_st.h"
#include "port_cfg_st.h"
#include "tor_version_st.h"
#include "test_dir_common.h"
#include "voting_schedule.h"
+#include "networkstatus_st.h"
#include "networkstatus_voter_info_st.h"
#include "vote_microdesc_hash_st.h"
#include "vote_routerstatus_st.h"
#include "dir_connection_st.h"
#include "dir_server_st.h"
+#include "networkstatus_st.h"
#include "rend_encoded_v2_service_descriptor_st.h"
#ifdef _WIN32
#include "nodelist.h"
#include "routerlist.h"
+#include "networkstatus_st.h"
#include "or_connection_st.h"
#include "test.h"
#include "cpath_build_state_st.h"
#include "crypt_path_st.h"
#include "dir_connection_st.h"
+#include "networkstatus_st.h"
#include "node_st.h"
#include "origin_circuit_st.h"
#include "routerparse.h"
#include "networkstatus.h"
+#include "networkstatus_st.h"
#include "vote_microdesc_hash_st.h"
#include "vote_routerstatus_st.h"
#include "proto_http.h"
#include "dir_connection_st.h"
+#include "networkstatus_st.h"
#include "hs_test_helpers.h"
#include "test_helpers.h"
#include "crypt_path_st.h"
#include "dir_connection_st.h"
#include "entry_connection_st.h"
+#include "networkstatus_st.h"
#include "origin_circuit_st.h"
#include "socks_request_st.h"
#include "util.h"
#include "voting_schedule.h"
+#include "networkstatus_st.h"
#include "node_st.h"
/** Test the validation of HS v3 addresses */
#include "cpath_build_state_st.h"
#include "crypt_path_st.h"
+#include "networkstatus_st.h"
#include "node_st.h"
#include "origin_circuit_st.h"
#include "routerparse.h"
#include "torcert.h"
+#include "networkstatus_st.h"
+
#include "test.h"
#ifdef _WIN32
#include "nodelist.h"
#include "torcert.h"
+#include "networkstatus_st.h"
#include "node_st.h"
#include "test.h"
#include "statefile.h"
#include "dir_connection_st.h"
+#include "networkstatus_st.h"
#include "node_st.h"
#include "test.h"
#include "voting_schedule.h"
#include "dir_server_st.h"
+#include "networkstatus_st.h"
static authority_cert_t *mock_cert;