Expose tunPersist setting

This commit is contained in:
Sergey Abramchuk
2019-09-26 10:35:53 +03:00
parent 96cf2d1804
commit d1f794ae57
2 changed files with 16 additions and 0 deletions

View File

@@ -64,6 +64,11 @@ typedef NS_ENUM(NSInteger, OpenVPNTLSCertProfile);
*/
@property (nonatomic) NSInteger connectionTimeout;
/**
Keep tun interface active during pauses or reconnections
*/
@property (nonatomic) BOOL tunPersist;
/**
If YES and a redirect-gateway profile doesn't also define
DNS servers, use the standard Google DNS servers.

View File

@@ -308,6 +308,14 @@ NSString *const OpenVPNTLSCertProfileDefaultValue = @"default";
_config.connTimeout = connectionTimeout;
}
- (BOOL)tunPersist {
return _config.tunPersist;
}
- (void)setTunPersist:(BOOL)tunPersist {
_config.tunPersist = tunPersist;
}
- (BOOL)googleDNSFallback {
return _config.googleDnsFallback;
}
@@ -477,6 +485,7 @@ NSString *const OpenVPNTLSCertProfileDefaultValue = @"default";
configuration.proto = self.proto;
configuration.ipv6 = self.ipv6;
configuration.connectionTimeout = self.connectionTimeout;
configuration.tunPersist = self.tunPersist;
configuration.googleDNSFallback = self.googleDNSFallback;
configuration.synchronousDNSLookup = self.synchronousDNSLookup;
configuration.autologinSessions = self.autologinSessions;
@@ -503,6 +512,7 @@ NSString *const OpenVPNTLSCertProfileDefaultValue = @"default";
[aCoder encodeInteger:self.proto forKey:NSStringFromSelector(@selector(proto))];
[aCoder encodeInteger:self.ipv6 forKey:NSStringFromSelector(@selector(ipv6))];
[aCoder encodeInteger:self.connectionTimeout forKey:NSStringFromSelector(@selector(connectionTimeout))];
[aCoder encodeBool:self.tunPersist forKey:NSStringFromSelector(@selector(tunPersist))];
[aCoder encodeBool:self.googleDNSFallback forKey:NSStringFromSelector(@selector(googleDNSFallback))];
[aCoder encodeBool:self.synchronousDNSLookup forKey:NSStringFromSelector(@selector(synchronousDNSLookup))];
[aCoder encodeBool:self.autologinSessions forKey:NSStringFromSelector(@selector(autologinSessions))];
@@ -529,6 +539,7 @@ NSString *const OpenVPNTLSCertProfileDefaultValue = @"default";
self.proto = (OpenVPNTransportProtocol)[aDecoder decodeIntegerForKey:NSStringFromSelector(@selector(proto))];
self.ipv6 = (OpenVPNIPv6Preference)[aDecoder decodeIntegerForKey:NSStringFromSelector(@selector(ipv6))];
self.connectionTimeout = [aDecoder decodeIntegerForKey:NSStringFromSelector(@selector(connectionTimeout))];
self.tunPersist = [aDecoder decodeBoolForKey:NSStringFromSelector(@selector(tunPersist))];
self.googleDNSFallback = [aDecoder decodeBoolForKey:NSStringFromSelector(@selector(googleDNSFallback))];
self.synchronousDNSLookup = [aDecoder decodeBoolForKey:NSStringFromSelector(@selector(synchronousDNSLookup))];
self.autologinSessions = [aDecoder decodeBoolForKey:NSStringFromSelector(@selector(autologinSessions))];