mirror of
https://github.com/deneraraujo/OpenVPNAdapter.git
synced 2026-02-11 00:00:08 +08:00
Expose tunPersist setting
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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))];
|
||||
|
||||
Reference in New Issue
Block a user