mirror of
https://github.com/passepartoutvpn/passepartout-apple.git
synced 2025-02-01 21:42:10 +00:00
Fix imports in NetworkSettingsBuilder
Also drop OpenVPN prefix, reserved for public entities.
This commit is contained in:
parent
faf9758a5c
commit
b3ebcfb6c8
@ -24,12 +24,7 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if !PP_FRAMEWORK
|
||||
import PassepartoutCore
|
||||
import PassepartoutOpenVPN
|
||||
#endif
|
||||
|
||||
extension OpenVPN {
|
||||
import PassepartoutKit
|
||||
|
||||
/// Merges local and remote settings.
|
||||
///
|
||||
@ -37,12 +32,12 @@ extension OpenVPN {
|
||||
struct NetworkSettingsBuilder {
|
||||
|
||||
/// The client options.
|
||||
let localOptions: Configuration
|
||||
let localOptions: OpenVPN.Configuration
|
||||
|
||||
/// The server options.
|
||||
let remoteOptions: Configuration
|
||||
let remoteOptions: OpenVPN.Configuration
|
||||
|
||||
init(localOptions: Configuration, remoteOptions: Configuration) {
|
||||
init(localOptions: OpenVPN.Configuration, remoteOptions: OpenVPN.Configuration) {
|
||||
self.localOptions = localOptions
|
||||
self.remoteOptions = remoteOptions
|
||||
}
|
||||
@ -78,11 +73,10 @@ extension OpenVPN {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Pull
|
||||
|
||||
private extension OpenVPN.NetworkSettingsBuilder {
|
||||
private extension NetworkSettingsBuilder {
|
||||
var pullRoutes: Bool {
|
||||
!(localOptions.noPullMask?.contains(.routes) ?? false)
|
||||
}
|
||||
@ -98,7 +92,7 @@ private extension OpenVPN.NetworkSettingsBuilder {
|
||||
|
||||
// MARK: - Overall
|
||||
|
||||
private extension OpenVPN.NetworkSettingsBuilder {
|
||||
private extension NetworkSettingsBuilder {
|
||||
var isGateway: Bool {
|
||||
isIPv4Gateway || isIPv6Gateway
|
||||
}
|
||||
@ -166,7 +160,7 @@ private extension OpenVPN.NetworkSettingsBuilder {
|
||||
|
||||
// MARK: - IP
|
||||
|
||||
private extension OpenVPN.NetworkSettingsBuilder {
|
||||
private extension NetworkSettingsBuilder {
|
||||
|
||||
// IPv4/6 address/mask MUST come from server options
|
||||
// routes, instead, can both come from server and local options
|
||||
@ -241,7 +235,7 @@ private extension OpenVPN.NetworkSettingsBuilder {
|
||||
|
||||
// MARK: - DNS
|
||||
|
||||
private extension OpenVPN.NetworkSettingsBuilder {
|
||||
private extension NetworkSettingsBuilder {
|
||||
private var dnsModule: Module? {
|
||||
let dnsServers = allDNSServers
|
||||
guard !dnsServers.isEmpty else {
|
||||
@ -278,7 +272,7 @@ private extension OpenVPN.NetworkSettingsBuilder {
|
||||
|
||||
// MARK: - HTTP Proxy
|
||||
|
||||
private extension OpenVPN.NetworkSettingsBuilder {
|
||||
private extension NetworkSettingsBuilder {
|
||||
private var httpProxyModule: Module? {
|
||||
var proxySettings: HTTPProxyModule.Builder?
|
||||
|
||||
|
@ -174,7 +174,7 @@ extension OpenVPNConnection: OpenVPNSessionDelegate {
|
||||
|
||||
environment.setEnvironmentValue(remoteOptions, forKey: TunnelEnvironmentKeys.OpenVPN.serverConfiguration)
|
||||
|
||||
let builder = OpenVPN.NetworkSettingsBuilder(localOptions: configuration, remoteOptions: remoteOptions)
|
||||
let builder = NetworkSettingsBuilder(localOptions: configuration, remoteOptions: remoteOptions)
|
||||
builder.print()
|
||||
do {
|
||||
try await controller.setTunnelSettings(with: TunnelRemoteInfo(
|
||||
|
Loading…
Reference in New Issue
Block a user