summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--mullvad-relay-selector/src/relay_selector/mod.rs63
1 files changed, 29 insertions, 34 deletions
diff --git a/mullvad-relay-selector/src/relay_selector/mod.rs b/mullvad-relay-selector/src/relay_selector/mod.rs
index 1adb49c2b9..7f7517923c 100644
--- a/mullvad-relay-selector/src/relay_selector/mod.rs
+++ b/mullvad-relay-selector/src/relay_selector/mod.rs
@@ -6,45 +6,39 @@ mod matcher;
mod parsed_relays;
pub mod query;
-use chrono::{DateTime, Local};
-use itertools::Itertools;
-use query::ObfuscationQuery;
-use std::{
- path::Path,
- sync::{Arc, LazyLock, Mutex},
- time::SystemTime,
-};
+use matcher::{filter_matching_bridges, filter_matching_relay_list};
+use parsed_relays::ParsedRelays;
-use mullvad_types::{
- constraints::Constraint,
- custom_list::CustomListsSettings,
- endpoint::MullvadWireguardEndpoint,
- location::{Coordinates, Location},
- relay_constraints::{
- BridgeSettings, BridgeState, InternalBridgeConstraints, ObfuscationSettings,
- OpenVpnConstraints, RelayConstraints, RelayOverride, RelaySettings, ResolvedBridgeSettings,
- WireguardConstraints,
- },
- relay_list::{Relay, RelayEndpointData, RelayList},
- settings::Settings,
- wireguard::QuantumResistantState,
- CustomTunnelEndpoint, Intersection,
-};
-use talpid_types::{
- net::{
- obfuscation::ObfuscatorConfig, proxy::CustomProxy, Endpoint, TransportProtocol, TunnelType,
- },
- ErrorExt,
+use crate::detailer::{openvpn_endpoint, wireguard_endpoint};
+use crate::error::{EndpointErrorDetails, Error};
+use crate::query::{
+ BridgeQuery, ObfuscationQuery, OpenVpnRelayQuery, RelayQuery, WireguardRelayQuery,
};
-use crate::error::{EndpointErrorDetails, Error};
+use std::path::Path;
+use std::sync::{Arc, LazyLock, Mutex};
+use std::time::SystemTime;
+
+use chrono::{DateTime, Local};
+use itertools::Itertools;
-use self::{
- detailer::{openvpn_endpoint, wireguard_endpoint},
- matcher::{filter_matching_bridges, filter_matching_relay_list},
- parsed_relays::ParsedRelays,
- query::{BridgeQuery, OpenVpnRelayQuery, RelayQuery, WireguardRelayQuery},
+use mullvad_types::constraints::Constraint;
+use mullvad_types::custom_list::CustomListsSettings;
+use mullvad_types::endpoint::MullvadWireguardEndpoint;
+use mullvad_types::location::{Coordinates, Location};
+use mullvad_types::relay_constraints::{
+ BridgeSettings, BridgeState, InternalBridgeConstraints, ObfuscationSettings,
+ OpenVpnConstraints, RelayConstraints, RelayOverride, RelaySettings, ResolvedBridgeSettings,
+ WireguardConstraints,
+};
+use mullvad_types::relay_list::{Relay, RelayEndpointData, RelayList};
+use mullvad_types::settings::Settings;
+use mullvad_types::wireguard::QuantumResistantState;
+use mullvad_types::{CustomTunnelEndpoint, Intersection};
+use talpid_types::net::{
+ obfuscation::ObfuscatorConfig, proxy::CustomProxy, Endpoint, TransportProtocol, TunnelType,
};
+use talpid_types::ErrorExt;
/// [`RETRY_ORDER`] defines an ordered set of relay parameters which the relay selector should
/// prioritize on successive connection attempts. Note that these will *never* override user
@@ -221,6 +215,7 @@ pub enum GetRelay {
Custom(CustomTunnelEndpoint),
}
+// TODO: Import `Either` and convert `Multihop` and `Singlehop` into concrete types.
/// This struct defines the different Wireguard relays the the relay selector can end up selecting
/// for an arbitrary Wireguard [`query`].
///