From 4c8f8ff1b630ee5a2ef088976605bbf05bc2b8fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Stuczy=C5=84ski?= Date: Wed, 23 Jun 2021 15:38:52 +0100 Subject: [PATCH] Renamed 'rtt_measurement' to verloc to avoid confusion --- clients/native/src/client/config/template.rs | 2 +- clients/socks5/src/client/config/template.rs | 2 +- common/mixnode-common/src/lib.rs | 2 +- .../src/{rtt_measurement => verloc}/error.rs | 0 .../src/{rtt_measurement => verloc}/listener.rs | 4 ++-- .../src/{rtt_measurement => verloc}/measurement.rs | 0 .../src/{rtt_measurement => verloc}/mod.rs | 6 +++--- .../src/{rtt_measurement => verloc}/packet.rs | 2 +- .../src/{rtt_measurement => verloc}/sender.rs | 6 +++--- gateway/src/config/template.rs | 2 +- mixnode/src/config/template.rs | 2 +- mixnode/src/node/http/verloc.rs | 2 +- mixnode/src/node/mod.rs | 12 ++++++------ 13 files changed, 21 insertions(+), 21 deletions(-) rename common/mixnode-common/src/{rtt_measurement => verloc}/error.rs (100%) rename common/mixnode-common/src/{rtt_measurement => verloc}/listener.rs (98%) rename common/mixnode-common/src/{rtt_measurement => verloc}/measurement.rs (100%) rename common/mixnode-common/src/{rtt_measurement => verloc}/mod.rs (98%) rename common/mixnode-common/src/{rtt_measurement => verloc}/packet.rs (98%) rename common/mixnode-common/src/{rtt_measurement => verloc}/sender.rs (97%) diff --git a/clients/native/src/client/config/template.rs b/clients/native/src/client/config/template.rs index 2c8a69444d..99e1b867c8 100644 --- a/clients/native/src/client/config/template.rs +++ b/clients/native/src/client/config/template.rs @@ -16,7 +16,7 @@ pub(crate) fn config_template() -> &'static str { // While using normal toml marshalling would have been way simpler with less overhead, // I think it's useful to have comments attached to the saved config file to explain behaviour of // particular fields. - // Note: any changes to the template must be reflected in the appropriate structs in mod.rs. + // Note: any changes to the template must be reflected in the appropriate structs in verloc. r#" # This is a TOML config file. # For more information, see https://github.com/toml-lang/toml diff --git a/clients/socks5/src/client/config/template.rs b/clients/socks5/src/client/config/template.rs index 614a7f6ed6..791580718a 100644 --- a/clients/socks5/src/client/config/template.rs +++ b/clients/socks5/src/client/config/template.rs @@ -16,7 +16,7 @@ pub(crate) fn config_template() -> &'static str { // While using normal toml marshalling would have been way simpler with less overhead, // I think it's useful to have comments attached to the saved config file to explain behaviour of // particular fields. - // Note: any changes to the template must be reflected in the appropriate structs in mod.rs. + // Note: any changes to the template must be reflected in the appropriate structs in verloc. r#" # This is a TOML config file. # For more information, see https://github.com/toml-lang/toml diff --git a/common/mixnode-common/src/lib.rs b/common/mixnode-common/src/lib.rs index b0eba79f06..a7e8a54485 100644 --- a/common/mixnode-common/src/lib.rs +++ b/common/mixnode-common/src/lib.rs @@ -13,4 +13,4 @@ // limitations under the License. pub mod cached_packet_processor; -pub mod rtt_measurement; +pub mod verloc; diff --git a/common/mixnode-common/src/rtt_measurement/error.rs b/common/mixnode-common/src/verloc/error.rs similarity index 100% rename from common/mixnode-common/src/rtt_measurement/error.rs rename to common/mixnode-common/src/verloc/error.rs diff --git a/common/mixnode-common/src/rtt_measurement/listener.rs b/common/mixnode-common/src/verloc/listener.rs similarity index 98% rename from common/mixnode-common/src/rtt_measurement/listener.rs rename to common/mixnode-common/src/verloc/listener.rs index 00ea7616f0..0b8025dde7 100644 --- a/common/mixnode-common/src/rtt_measurement/listener.rs +++ b/common/mixnode-common/src/verloc/listener.rs @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::rtt_measurement::error::RttError; -use crate::rtt_measurement::packet::{EchoPacket, ReplyPacket}; +use crate::verloc::error::RttError; +use crate::verloc::packet::{EchoPacket, ReplyPacket}; use bytes::{BufMut, BytesMut}; use crypto::asymmetric::identity; use futures::StreamExt; diff --git a/common/mixnode-common/src/rtt_measurement/measurement.rs b/common/mixnode-common/src/verloc/measurement.rs similarity index 100% rename from common/mixnode-common/src/rtt_measurement/measurement.rs rename to common/mixnode-common/src/verloc/measurement.rs diff --git a/common/mixnode-common/src/rtt_measurement/mod.rs b/common/mixnode-common/src/verloc/mod.rs similarity index 98% rename from common/mixnode-common/src/rtt_measurement/mod.rs rename to common/mixnode-common/src/verloc/mod.rs index 2a351eef49..fc6417ad4f 100644 --- a/common/mixnode-common/src/rtt_measurement/mod.rs +++ b/common/mixnode-common/src/verloc/mod.rs @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::rtt_measurement::listener::PacketListener; -pub use crate::rtt_measurement::measurement::{AtomicVerlocResult, Verloc, VerlocResult}; -use crate::rtt_measurement::sender::{PacketSender, TestedNode}; +use crate::verloc::listener::PacketListener; +pub use crate::verloc::measurement::{AtomicVerlocResult, Verloc, VerlocResult}; +use crate::verloc::sender::{PacketSender, TestedNode}; use crypto::asymmetric::identity; use futures::stream::FuturesUnordered; use futures::StreamExt; diff --git a/common/mixnode-common/src/rtt_measurement/packet.rs b/common/mixnode-common/src/verloc/packet.rs similarity index 98% rename from common/mixnode-common/src/rtt_measurement/packet.rs rename to common/mixnode-common/src/verloc/packet.rs index d25b12b1b7..d899273694 100644 --- a/common/mixnode-common/src/rtt_measurement/packet.rs +++ b/common/mixnode-common/src/verloc/packet.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::rtt_measurement::error::RttError; +use crate::verloc::error::RttError; use crypto::asymmetric::identity::{self, PUBLIC_KEY_LENGTH, SIGNATURE_LENGTH}; use std::convert::TryInto; diff --git a/common/mixnode-common/src/rtt_measurement/sender.rs b/common/mixnode-common/src/verloc/sender.rs similarity index 97% rename from common/mixnode-common/src/rtt_measurement/sender.rs rename to common/mixnode-common/src/verloc/sender.rs index 4bbefd2dac..2f45d99854 100644 --- a/common/mixnode-common/src/rtt_measurement/sender.rs +++ b/common/mixnode-common/src/verloc/sender.rs @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::rtt_measurement::error::RttError; -use crate::rtt_measurement::measurement::Measurement; -use crate::rtt_measurement::packet::{EchoPacket, ReplyPacket}; +use crate::verloc::error::RttError; +use crate::verloc::measurement::Measurement; +use crate::verloc::packet::{EchoPacket, ReplyPacket}; use crypto::asymmetric::identity; use log::*; use rand::{thread_rng, Rng}; diff --git a/gateway/src/config/template.rs b/gateway/src/config/template.rs index 2ac303b465..c4522abfdd 100644 --- a/gateway/src/config/template.rs +++ b/gateway/src/config/template.rs @@ -5,7 +5,7 @@ pub(crate) fn config_template() -> &'static str { // While using normal toml marshalling would have been way simpler with less overhead, // I think it's useful to have comments attached to the saved config file to explain behaviour of // particular fields. - // Note: any changes to the template must be reflected in the appropriate structs in mod.rs. + // Note: any changes to the template must be reflected in the appropriate structs in verloc. r#" # This is a TOML config file. # For more information, see https://github.com/toml-lang/toml diff --git a/mixnode/src/config/template.rs b/mixnode/src/config/template.rs index 404dacb409..2ef91b3f9f 100644 --- a/mixnode/src/config/template.rs +++ b/mixnode/src/config/template.rs @@ -5,7 +5,7 @@ pub(crate) fn config_template() -> &'static str { // While using normal toml marshalling would have been way simpler with less overhead, // I think it's useful to have comments attached to the saved config file to explain behaviour of // particular fields. - // Note: any changes to the template must be reflected in the appropriate structs in mod.rs. + // Note: any changes to the template must be reflected in the appropriate structs in verloc. r#" # This is a TOML config file. # For more information, see https://github.com/toml-lang/toml diff --git a/mixnode/src/node/http/verloc.rs b/mixnode/src/node/http/verloc.rs index 9d71ee67a3..4a9643aa12 100644 --- a/mixnode/src/node/http/verloc.rs +++ b/mixnode/src/node/http/verloc.rs @@ -1,4 +1,4 @@ -use mixnode_common::rtt_measurement::{AtomicVerlocResult, VerlocResult}; +use mixnode_common::verloc::{AtomicVerlocResult, VerlocResult}; use rocket::State; use rocket_contrib::json::Json; diff --git a/mixnode/src/node/mod.rs b/mixnode/src/node/mod.rs index 3b5ed2219e..d64b8acfdd 100644 --- a/mixnode/src/node/mod.rs +++ b/mixnode/src/node/mod.rs @@ -6,7 +6,7 @@ use crate::node::http::{ description::description, not_found, stats::stats, - verloc::{verloc, VerlocState}, + verloc::{verloc as verlocRoute, VerlocState}, }; use crate::node::listener::connection_handler::packet_processing::PacketProcessor; use crate::node::listener::connection_handler::ConnectionHandler; @@ -16,7 +16,7 @@ use crate::node::node_statistics::NodeStatsWrapper; use crate::node::packet_delayforwarder::{DelayForwarder, PacketDelayForwardSender}; use crypto::asymmetric::{encryption, identity}; use log::{error, info, warn}; -use mixnode_common::rtt_measurement::{self, AtomicVerlocResult, RttMeasurer}; +use mixnode_common::verloc::{self, AtomicVerlocResult, RttMeasurer}; use std::net::SocketAddr; use std::process; use std::sync::Arc; @@ -70,7 +70,7 @@ impl MixNode { tokio::spawn(async move { rocket::build() .configure(config) - .mount("/", routes![verloc, description, stats]) + .mount("/", routes![verlocRoute, description, stats]) .register("/", catchers![not_found]) .manage(verloc_state) .manage(descriptor) @@ -143,7 +143,7 @@ impl MixNode { // if this code exists in the node, it MUST BE compatible let config_version = parse_version(self.config.get_version()).expect("malformed version in the config file"); - let minimum_version = parse_version(rtt_measurement::MINIMUM_NODE_VERSION).unwrap(); + let minimum_version = parse_version(verloc::MINIMUM_NODE_VERSION).unwrap(); if config_version < minimum_version { error!("You seem to have not updated your mixnode configuration file - please run `upgrade` before attempting again"); process::exit(1) @@ -153,10 +153,10 @@ impl MixNode { let listening_address = SocketAddr::new( self.config.get_listening_address(), - rtt_measurement::DEFAULT_MEASUREMENT_PORT, + verloc::DEFAULT_MEASUREMENT_PORT, ); - let config = rtt_measurement::ConfigBuilder::new() + let config = verloc::ConfigBuilder::new() .listening_address(listening_address) .packets_per_node(self.config.get_measurement_packets_per_node()) .connection_timeout(self.config.get_measurement_connection_timeout())