2017-04-21 23:41:08 +08:00
|
|
|
//
|
|
|
|
// OpenVPNConfiguration.h
|
|
|
|
// OpenVPN Adapter
|
|
|
|
//
|
|
|
|
// Created by Sergey Abramchuk on 21.04.17.
|
|
|
|
//
|
|
|
|
//
|
|
|
|
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
|
2017-04-22 00:28:09 +08:00
|
|
|
// TODO: Wrap ClientAPI::Config into Objective-C class
|
|
|
|
|
2017-04-23 18:35:34 +08:00
|
|
|
/**
|
|
|
|
IPv6 preference options
|
|
|
|
*/
|
|
|
|
typedef NS_ENUM(NSInteger, IPv6Preference) {
|
2017-04-23 18:54:54 +08:00
|
|
|
/// Request combined IPv4/IPv6 tunnel
|
2017-04-23 18:35:34 +08:00
|
|
|
IPv6PreferenceEnabled,
|
2017-04-23 18:54:54 +08:00
|
|
|
/// Disable IPv6, so tunnel will be IPv4-only
|
2017-04-23 18:35:34 +08:00
|
|
|
IPv6PreferenceDisabled,
|
2017-04-23 18:54:54 +08:00
|
|
|
/// Leave decision to server
|
2017-04-23 18:35:34 +08:00
|
|
|
IPv6PreferenceDefault
|
|
|
|
};
|
|
|
|
|
2017-04-21 23:41:08 +08:00
|
|
|
@interface OpenVPNConfiguration : NSObject
|
|
|
|
|
2017-04-23 01:19:28 +08:00
|
|
|
/**
|
|
|
|
OpenVPN profile as a NSData
|
|
|
|
*/
|
2017-04-22 00:28:09 +08:00
|
|
|
@property (nullable, nonatomic) NSData *fileContent;
|
|
|
|
|
2017-04-23 01:19:28 +08:00
|
|
|
/**
|
|
|
|
OpenVPN profile as series of key/value pairs (may be provided exclusively
|
|
|
|
or in addition to file content).
|
|
|
|
*/
|
|
|
|
@property (nullable, nonatomic) NSDictionary<NSString *, NSString *> *settings;
|
|
|
|
|
2017-04-23 03:45:16 +08:00
|
|
|
/**
|
|
|
|
Set to identity OpenVPN GUI version.
|
|
|
|
Format should be "<gui_identifier><space><version>"
|
|
|
|
Passed to server as IV_GUI_VER.
|
|
|
|
*/
|
|
|
|
@property (nullable, nonatomic) NSString *guiVersion;
|
2017-04-23 01:19:28 +08:00
|
|
|
|
2017-04-23 18:07:08 +08:00
|
|
|
/**
|
|
|
|
Use a different server than that specified in "remote"
|
|
|
|
option of profile
|
|
|
|
*/
|
|
|
|
@property (nullable, nonatomic) NSString *serverOverride;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Force a given transport protocol
|
|
|
|
Should be tcp, udp, or adaptive.
|
|
|
|
*/
|
|
|
|
@property (nullable, nonatomic) NSString *protoOverride;
|
|
|
|
|
2017-04-23 18:35:34 +08:00
|
|
|
/**
|
|
|
|
IPv6 preference
|
|
|
|
*/
|
|
|
|
@property (nonatomic) IPv6Preference ipv6;
|
|
|
|
|
2017-04-23 18:54:54 +08:00
|
|
|
/**
|
|
|
|
Connection timeout in seconds, or 0 to retry indefinitely
|
|
|
|
*/
|
|
|
|
@property (nonatomic) NSInteger connectionTimeout;
|
|
|
|
|
2017-04-23 19:02:55 +08:00
|
|
|
/**
|
|
|
|
Keep tun interface active during pauses or reconnections
|
|
|
|
*/
|
|
|
|
@property (nonatomic) BOOL tunPersist;
|
|
|
|
|
2017-04-23 19:10:40 +08:00
|
|
|
/**
|
|
|
|
If true and a redirect-gateway profile doesn't also define
|
|
|
|
DNS servers, use the standard Google DNS servers.
|
|
|
|
*/
|
|
|
|
@property (nonatomic) BOOL googleDNSFallback;
|
|
|
|
|
2017-04-21 23:41:08 +08:00
|
|
|
@end
|