mirror of
https://github.com/deneraraujo/OpenVPNAdapter.git
synced 2026-04-24 00:00:05 +08:00
Apply style guide rules to the openvpn configuration class
This commit is contained in:
@@ -6,29 +6,33 @@
|
|||||||
//
|
//
|
||||||
//
|
//
|
||||||
|
|
||||||
#import <client/ovpncli.hpp>
|
|
||||||
|
|
||||||
#import "OpenVPNConfiguration.h"
|
#import "OpenVPNConfiguration.h"
|
||||||
|
|
||||||
|
#include <client/ovpncli.hpp>
|
||||||
|
|
||||||
using namespace openvpn;
|
using namespace openvpn;
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@interface OpenVPNConfiguration (Internal)
|
@interface OpenVPNConfiguration (Internal)
|
||||||
|
|
||||||
@property (readonly) ClientAPI::Config config;
|
@property (readonly) ClientAPI::Config config;
|
||||||
|
|
||||||
+ (OpenVPNTransportProtocol)getTransportProtocolFromValue:(nullable NSString *)value;
|
+ (OpenVPNTransportProtocol)getTransportProtocolFromValue:(nullable NSString *)value;
|
||||||
+ (nonnull NSString *)getValueFromTransportProtocol:(OpenVPNTransportProtocol)protocol;
|
+ (NSString *)getValueFromTransportProtocol:(OpenVPNTransportProtocol)protocol;
|
||||||
|
|
||||||
+ (OpenVPNIPv6Preference)getIPv6PreferenceFromValue:(nullable NSString *)value;
|
+ (OpenVPNIPv6Preference)getIPv6PreferenceFromValue:(nullable NSString *)value;
|
||||||
+ (nonnull NSString *)getValueFromIPv6Preference:(OpenVPNIPv6Preference)preference;
|
+ (NSString *)getValueFromIPv6Preference:(OpenVPNIPv6Preference)preference;
|
||||||
|
|
||||||
+ (OpenVPNCompressionMode)getCompressionModeFromValue:(nullable NSString *)value;
|
+ (OpenVPNCompressionMode)getCompressionModeFromValue:(nullable NSString *)value;
|
||||||
+ (nonnull NSString *)getValueFromCompressionMode:(OpenVPNCompressionMode)compressionMode;
|
+ (NSString *)getValueFromCompressionMode:(OpenVPNCompressionMode)compressionMode;
|
||||||
|
|
||||||
+ (OpenVPNMinTLSVersion)getMinTLSFromValue:(nullable NSString *)value;
|
+ (OpenVPNMinTLSVersion)getMinTLSFromValue:(nullable NSString *)value;
|
||||||
+ (nonnull NSString *)getValueFromMinTLS:(OpenVPNMinTLSVersion)minTLS;
|
+ (NSString *)getValueFromMinTLS:(OpenVPNMinTLSVersion)minTLS;
|
||||||
|
|
||||||
+ (OpenVPNTLSCertProfile)getTLSCertProfileFromValue:(nullable NSString *)value;
|
+ (OpenVPNTLSCertProfile)getTLSCertProfileFromValue:(nullable NSString *)value;
|
||||||
+ (nonnull NSString *)getValueFromTLSCertProfile:(OpenVPNTLSCertProfile)tlsCertProfile;
|
+ (NSString *)getValueFromTLSCertProfile:(OpenVPNTLSCertProfile)tlsCertProfile;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -8,11 +8,11 @@
|
|||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
#import "OpenVPNTransportProtocol.h"
|
typedef NS_ENUM(NSInteger, OpenVPNTransportProtocol);
|
||||||
#import "OpenVPNIPv6Preference.h"
|
typedef NS_ENUM(NSInteger, OpenVPNIPv6Preference);
|
||||||
#import "OpenVPNCompressionMode.h"
|
typedef NS_ENUM(NSInteger, OpenVPNCompressionMode);
|
||||||
#import "OpenVPNMinTLSVersion.h"
|
typedef NS_ENUM(NSInteger, OpenVPNMinTLSVersion);
|
||||||
#import "OpenVPNTLSCertProfile.h"
|
typedef NS_ENUM(NSInteger, OpenVPNTLSCertProfile);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Class used to pass configuration
|
Class used to pass configuration
|
||||||
|
|||||||
@@ -6,8 +6,15 @@
|
|||||||
//
|
//
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#import "OpenVPNConfiguration.h"
|
||||||
#import "OpenVPNConfiguration+Internal.h"
|
#import "OpenVPNConfiguration+Internal.h"
|
||||||
|
|
||||||
|
#import "OpenVPNTransportProtocol.h"
|
||||||
|
#import "OpenVPNIPv6Preference.h"
|
||||||
|
#import "OpenVPNCompressionMode.h"
|
||||||
|
#import "OpenVPNMinTLSVersion.h"
|
||||||
|
#import "OpenVPNTLSCertProfile.h"
|
||||||
|
|
||||||
using namespace openvpn;
|
using namespace openvpn;
|
||||||
|
|
||||||
NSString *const OpenVPNTransportProtocolUDPValue = @"udp";
|
NSString *const OpenVPNTransportProtocolUDPValue = @"udp";
|
||||||
@@ -494,7 +501,7 @@ NSString *const OpenVPNTLSCertProfileDefaultValue = @"default";
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (instancetype)initWithCoder:(NSCoder *)aDecoder {
|
- (instancetype)initWithCoder:(NSCoder *)aDecoder {
|
||||||
if ((self = [self init])) {
|
if (self = [self init]) {
|
||||||
self.fileContent = [aDecoder decodeObjectOfClass:[NSData class] forKey:NSStringFromSelector(@selector(fileContent))];
|
self.fileContent = [aDecoder decodeObjectOfClass:[NSData class] forKey:NSStringFromSelector(@selector(fileContent))];
|
||||||
self.settings = [aDecoder decodeObjectOfClass:[NSDictionary class] forKey:NSStringFromSelector(@selector(settings))];
|
self.settings = [aDecoder decodeObjectOfClass:[NSDictionary class] forKey:NSStringFromSelector(@selector(settings))];
|
||||||
self.guiVersion = [aDecoder decodeObjectOfClass:[NSString class] forKey:NSStringFromSelector(@selector(guiVersion))];
|
self.guiVersion = [aDecoder decodeObjectOfClass:[NSString class] forKey:NSStringFromSelector(@selector(guiVersion))];
|
||||||
|
|||||||
Reference in New Issue
Block a user