-
Notifications
You must be signed in to change notification settings - Fork 354
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade settings to associate with multi-hop
- Loading branch information
Showing
27 changed files
with
623 additions
and
320 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
ios/MullvadREST/Relay/NoRelaysSatisfyingConstraintsError.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// NoRelaysSatisfyingConstraintsError.swift | ||
// MullvadREST | ||
// | ||
// Created by Mojgan on 2024-04-26. | ||
// Copyright © 2024 Mullvad VPN AB. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
public struct NoRelaysSatisfyingConstraintsError: LocalizedError { | ||
public var errorDescription: String? { | ||
"No relays satisfying constraints." | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// RelaySelectorResult.swift | ||
// MullvadREST | ||
// | ||
// Created by Mojgan on 2024-05-14. | ||
// Copyright © 2024 Mullvad VPN AB. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import MullvadTypes | ||
|
||
public typealias RelaySelectorResult = RelaySelectorMatch | ||
|
||
public struct RelaySelectorMatch: Codable, Equatable { | ||
public var endpoint: MullvadEndpoint | ||
public var relay: REST.ServerRelay | ||
public var location: Location | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// MultihopSettings.swift | ||
// MullvadSettings | ||
// | ||
// Created by Mojgan on 2024-04-26. | ||
// Copyright © 2024 Mullvad VPN AB. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
/// Whether Multi-hop is enabled | ||
public enum MultihopState: Codable { | ||
case on | ||
case off | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// | ||
// TunnelSettingsV5.swift | ||
// MullvadSettings | ||
// | ||
// Created by Mojgan on 2024-05-13. | ||
// Copyright © 2024 Mullvad VPN AB. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import MullvadTypes | ||
|
||
public struct TunnelSettingsV5: Codable, Equatable, TunnelSettings { | ||
/// Relay constraints. | ||
public var relayConstraints: RelayConstraints | ||
|
||
/// DNS settings. | ||
public var dnsSettings: DNSSettings | ||
|
||
/// WireGuard obfuscation settings | ||
public var wireGuardObfuscation: WireGuardObfuscationSettings | ||
|
||
/// Whether Post Quantum exchanges are enabled. | ||
public var tunnelQuantumResistance: TunnelQuantumResistance | ||
|
||
/// Whether Multi-hop is enabled. | ||
public var tunnelMultihopState: MultihopState | ||
|
||
public init( | ||
relayConstraints: RelayConstraints = RelayConstraints(), | ||
dnsSettings: DNSSettings = DNSSettings(), | ||
wireGuardObfuscation: WireGuardObfuscationSettings = WireGuardObfuscationSettings(), | ||
tunnelQuantumResistance: TunnelQuantumResistance = .automatic, | ||
tunnelMultihopState: MultihopState = .off | ||
|
||
) { | ||
self.relayConstraints = relayConstraints | ||
self.dnsSettings = dnsSettings | ||
self.wireGuardObfuscation = wireGuardObfuscation | ||
self.tunnelQuantumResistance = tunnelQuantumResistance | ||
self.tunnelMultihopState = tunnelMultihopState | ||
} | ||
|
||
public func upgradeToNextVersion() -> any TunnelSettings { | ||
self | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.