mirror of
https://github.com/deneraraujo/OpenVPNAdapter.git
synced 2026-02-11 00:00:08 +08:00
Merge branch 'develop' into feature/convert-certificates
* develop: Change project name and header names Rename OpenVPNEvent to OpenVPNAdapterEvent
This commit is contained in:
@@ -113,7 +113,7 @@ extension OpenVPNAdapterTests: OpenVPNAdapterDelegate {
|
||||
callback(self)
|
||||
}
|
||||
|
||||
func handle(event: OpenVPNEvent, message: String?) {
|
||||
func handle(event: OpenVPNAdapterEvent, message: String?) {
|
||||
switch event {
|
||||
case .connected:
|
||||
guard let connectionExpectation = expectations[.connection] else { return }
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
C9B7956C1F1D26C900CF35FE /* OpenVPNReachability+Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = C9B795691F1D26C900CF35FE /* OpenVPNReachability+Internal.h */; };
|
||||
C9BB47601E71663A00F3F98C /* Umbrella-Header.h in Headers */ = {isa = PBXBuildFile; fileRef = C9BB475E1E71663A00F3F98C /* Umbrella-Header.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
C9BB47711E7171A100F3F98C /* OpenVPNError.h in Headers */ = {isa = PBXBuildFile; fileRef = C9BB476F1E7171A100F3F98C /* OpenVPNError.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
C9BB47721E7171A100F3F98C /* OpenVPNEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = C9BB47701E7171A100F3F98C /* OpenVPNEvent.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
C9BB47721E7171A100F3F98C /* OpenVPNAdapterEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = C9BB47701E7171A100F3F98C /* OpenVPNAdapterEvent.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
C9BB47791E7171ED00F3F98C /* OpenVPNClient.h in Headers */ = {isa = PBXBuildFile; fileRef = C9BB47771E7171ED00F3F98C /* OpenVPNClient.h */; };
|
||||
C9BB477A1E7171ED00F3F98C /* OpenVPNClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = C9BB47781E7171ED00F3F98C /* OpenVPNClient.mm */; };
|
||||
C9BB477F1E7173C700F3F98C /* OpenVPNAdapter.h in Headers */ = {isa = PBXBuildFile; fileRef = C9BB477B1E7173C700F3F98C /* OpenVPNAdapter.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
@@ -120,7 +120,7 @@
|
||||
C9D2ABE01EA20F99007EDF9D /* NetworkExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C912BB241E7C3339002B9414 /* NetworkExtension.framework */; };
|
||||
C9D2ABE11EA20F99007EDF9D /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C90BAD301E73FF6C00DEFB32 /* SystemConfiguration.framework */; };
|
||||
C9D2ABE31EA20F99007EDF9D /* OpenVPNClient.h in Headers */ = {isa = PBXBuildFile; fileRef = C9BB47771E7171ED00F3F98C /* OpenVPNClient.h */; };
|
||||
C9D2ABE41EA20F99007EDF9D /* OpenVPNEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = C9BB47701E7171A100F3F98C /* OpenVPNEvent.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
C9D2ABE41EA20F99007EDF9D /* OpenVPNAdapterEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = C9BB47701E7171A100F3F98C /* OpenVPNAdapterEvent.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
C9D2ABE51EA20F99007EDF9D /* OpenVPNAdapter.h in Headers */ = {isa = PBXBuildFile; fileRef = C9BB477B1E7173C700F3F98C /* OpenVPNAdapter.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
C9D2ABE61EA20F99007EDF9D /* Umbrella-Header.h in Headers */ = {isa = PBXBuildFile; fileRef = C9BB475E1E71663A00F3F98C /* Umbrella-Header.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
C9D2ABE71EA20F99007EDF9D /* OpenVPNAdapter+Public.h in Headers */ = {isa = PBXBuildFile; fileRef = C9BB477D1E7173C700F3F98C /* OpenVPNAdapter+Public.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
@@ -201,7 +201,7 @@
|
||||
C9BB475C1E71663A00F3F98C /* OpenVPNAdapter.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = OpenVPNAdapter.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
C9BB475E1E71663A00F3F98C /* Umbrella-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Umbrella-Header.h"; sourceTree = "<group>"; };
|
||||
C9BB476F1E7171A100F3F98C /* OpenVPNError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = OpenVPNError.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
|
||||
C9BB47701E7171A100F3F98C /* OpenVPNEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OpenVPNEvent.h; sourceTree = "<group>"; };
|
||||
C9BB47701E7171A100F3F98C /* OpenVPNAdapterEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OpenVPNAdapterEvent.h; sourceTree = "<group>"; };
|
||||
C9BB47771E7171ED00F3F98C /* OpenVPNClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OpenVPNClient.h; sourceTree = "<group>"; };
|
||||
C9BB47781E7171ED00F3F98C /* OpenVPNClient.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = OpenVPNClient.mm; sourceTree = "<group>"; };
|
||||
C9BB477B1E7173C700F3F98C /* OpenVPNAdapter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OpenVPNAdapter.h; sourceTree = "<group>"; };
|
||||
@@ -355,7 +355,7 @@
|
||||
children = (
|
||||
C9BB476F1E7171A100F3F98C /* OpenVPNError.h */,
|
||||
C93A4F611EE18009004DC561 /* OpenVPNError.m */,
|
||||
C9BB47701E7171A100F3F98C /* OpenVPNEvent.h */,
|
||||
C9BB47701E7171A100F3F98C /* OpenVPNAdapterEvent.h */,
|
||||
C9657A5D1EB0D60700EFF210 /* OpenVPNTransportProtocol.h */,
|
||||
C9657A601EB0D64E00EFF210 /* OpenVPNIPv6Preference.h */,
|
||||
C9657A631EB0D6AD00EFF210 /* OpenVPNCompressionMode.h */,
|
||||
@@ -532,7 +532,7 @@
|
||||
C9657A3A1EB0BAAB00EFF210 /* OpenVPNInterfaceStats+Internal.h in Headers */,
|
||||
C9354F451F1E4A4500F4C935 /* OpenVPNReachabilityStatus.h in Headers */,
|
||||
C9BCE25E1EB3C201009D6AC1 /* OpenVPNSessionToken+Internal.h in Headers */,
|
||||
C9BB47721E7171A100F3F98C /* OpenVPNEvent.h in Headers */,
|
||||
C9BB47721E7171A100F3F98C /* OpenVPNAdapterEvent.h in Headers */,
|
||||
C9BB477F1E7173C700F3F98C /* OpenVPNAdapter.h in Headers */,
|
||||
C9657A4C1EB0CD6C00EFF210 /* OpenVPNProperties.h in Headers */,
|
||||
C9657A571EB0CDFB00EFF210 /* OpenVPNProperties+Internal.h in Headers */,
|
||||
@@ -574,7 +574,7 @@
|
||||
C9657A3B1EB0BAAB00EFF210 /* OpenVPNInterfaceStats+Internal.h in Headers */,
|
||||
C9354F461F1E4A4600F4C935 /* OpenVPNReachabilityStatus.h in Headers */,
|
||||
C9BCE25F1EB3C201009D6AC1 /* OpenVPNSessionToken+Internal.h in Headers */,
|
||||
C9D2ABE41EA20F99007EDF9D /* OpenVPNEvent.h in Headers */,
|
||||
C9D2ABE41EA20F99007EDF9D /* OpenVPNAdapterEvent.h in Headers */,
|
||||
C9D2ABE51EA20F99007EDF9D /* OpenVPNAdapter.h in Headers */,
|
||||
C9657A4D1EB0CD6C00EFF210 /* OpenVPNProperties.h in Headers */,
|
||||
C9657A561EB0CDFA00EFF210 /* OpenVPNProperties+Internal.h in Headers */,
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
//
|
||||
//
|
||||
|
||||
#import "OpenVPNEvent.h"
|
||||
#import "OpenVPNAdapterEvent.h"
|
||||
#import "OpenVPNAdapter.h"
|
||||
|
||||
@class OpenVPNConfiguration;
|
||||
@@ -64,7 +64,7 @@ NS_SWIFT_NAME(configureTunnel(settings:callback:));
|
||||
@param event <#event description#>
|
||||
@param message <#message description#>
|
||||
*/
|
||||
- (void)handleEvent:(OpenVPNEvent)event
|
||||
- (void)handleEvent:(OpenVPNAdapterEvent)event
|
||||
message:(nullable NSString *)message
|
||||
NS_SWIFT_NAME(handle(event:message:));
|
||||
|
||||
@@ -115,7 +115,7 @@ NS_SWIFT_NAME(handle(logMessage:));
|
||||
|
||||
/**
|
||||
Return information about the most recent connection. Will be available
|
||||
after an event of type "OpenVPNEventConnected, otherwise return nil.
|
||||
after an event of type "OpenVPNAdapterEventConnected, otherwise return nil.
|
||||
*/
|
||||
@property (nullable, readonly, nonatomic) OpenVPNConnectionInfo *connectionInfo;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#import "OpenVPNTunnelSettings.h"
|
||||
#import "OpenVPNClient.h"
|
||||
#import "OpenVPNError.h"
|
||||
#import "OpenVPNEvent.h"
|
||||
#import "OpenVPNAdapterEvent.h"
|
||||
#import "OpenVPNConfiguration+Internal.h"
|
||||
#import "OpenVPNCredentials+Internal.h"
|
||||
#import "OpenVPNProperties+Internal.h"
|
||||
@@ -57,7 +57,7 @@
|
||||
|
||||
- (void)readTUNPackets;
|
||||
- (void)readVPNPacket:(NSData *)packet;
|
||||
- (OpenVPNEvent)eventByName:(NSString *)eventName;
|
||||
- (OpenVPNAdapterEvent)eventByName:(NSString *)eventName;
|
||||
- (OpenVPNAdapterError)errorByName:(NSString *)errorName;
|
||||
- (NSString *)reasonForError:(OpenVPNAdapterError)error;
|
||||
- (NSString *)subnetFromPrefixLength:(NSNumber *)prefixLength;
|
||||
@@ -356,7 +356,7 @@ static void socketCallback(CFSocketRef socket, CFSocketCallBackType type, CFData
|
||||
[self.delegate handleError:error];
|
||||
}];
|
||||
} else {
|
||||
OpenVPNEvent eventIdentifier = [self eventByName:name];
|
||||
OpenVPNAdapterEvent eventIdentifier = [self eventByName:name];
|
||||
[self performAsyncBlock:^{
|
||||
[self.delegate handleEvent:eventIdentifier message:message == nil || [message isEqualToString:@""] ? nil : message];
|
||||
}];
|
||||
@@ -625,26 +625,26 @@ static void socketCallback(CFSocketRef socket, CFSocketCallBackType type, CFData
|
||||
|
||||
#pragma mark Utils
|
||||
|
||||
- (OpenVPNEvent)eventByName:(NSString *)eventName {
|
||||
- (OpenVPNAdapterEvent)eventByName:(NSString *)eventName {
|
||||
NSDictionary *events = @{
|
||||
@"DISCONNECTED": @(OpenVPNEventDisconnected),
|
||||
@"CONNECTED": @(OpenVPNEventConnected),
|
||||
@"RECONNECTING": @(OpenVPNEventReconnecting),
|
||||
@"RESOLVE": @(OpenVPNEventResolve),
|
||||
@"WAIT": @(OpenVPNEventWait),
|
||||
@"WAIT_PROXY": @(OpenVPNEventWaitProxy),
|
||||
@"CONNECTING": @(OpenVPNEventConnecting),
|
||||
@"GET_CONFIG": @(OpenVPNEventGetConfig),
|
||||
@"ASSIGN_IP": @(OpenVPNEventAssignIP),
|
||||
@"ADD_ROUTES": @(OpenVPNEventAddRoutes),
|
||||
@"ECHO": @(OpenVPNEventEcho),
|
||||
@"INFO": @(OpenVPNEventInfo),
|
||||
@"PAUSE": @(OpenVPNEventPause),
|
||||
@"RESUME": @(OpenVPNEventResume),
|
||||
@"RELAY": @(OpenVPNEventRelay)
|
||||
@"DISCONNECTED": @(OpenVPNAdapterEventDisconnected),
|
||||
@"CONNECTED": @(OpenVPNAdapterEventConnected),
|
||||
@"RECONNECTING": @(OpenVPNAdapterEventReconnecting),
|
||||
@"RESOLVE": @(OpenVPNAdapterEventResolve),
|
||||
@"WAIT": @(OpenVPNAdapterEventWait),
|
||||
@"WAIT_PROXY": @(OpenVPNAdapterEventWaitProxy),
|
||||
@"CONNECTING": @(OpenVPNAdapterEventConnecting),
|
||||
@"GET_CONFIG": @(OpenVPNAdapterEventGetConfig),
|
||||
@"ASSIGN_IP": @(OpenVPNAdapterEventAssignIP),
|
||||
@"ADD_ROUTES": @(OpenVPNAdapterEventAddRoutes),
|
||||
@"ECHO": @(OpenVPNAdapterEventEcho),
|
||||
@"INFO": @(OpenVPNAdapterEventInfo),
|
||||
@"PAUSE": @(OpenVPNAdapterEventPause),
|
||||
@"RESUME": @(OpenVPNAdapterEventResume),
|
||||
@"RELAY": @(OpenVPNAdapterEventRelay)
|
||||
};
|
||||
|
||||
OpenVPNEvent event = events[eventName] != nil ? (OpenVPNEvent)[events[eventName] integerValue] : OpenVPNEventUnknown;
|
||||
OpenVPNAdapterEvent event = events[eventName] != nil ? (OpenVPNAdapterEvent)[events[eventName] integerValue] : OpenVPNAdapterEventUnknown;
|
||||
return event;
|
||||
}
|
||||
|
||||
|
||||
31
OpenVPN Adapter/OpenVPNAdapterEvent.h
Normal file
31
OpenVPN Adapter/OpenVPNAdapterEvent.h
Normal file
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// OpenVPNAdapterEvent.h
|
||||
// OpenVPN Adapter
|
||||
//
|
||||
// Created by Sergey Abramchuk on 05.11.16.
|
||||
// Copyright © 2016 ss-abramchuk. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
/**
|
||||
OpenVPN event codes
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, OpenVPNAdapterEvent) {
|
||||
OpenVPNAdapterEventDisconnected,
|
||||
OpenVPNAdapterEventConnected,
|
||||
OpenVPNAdapterEventReconnecting,
|
||||
OpenVPNAdapterEventResolve,
|
||||
OpenVPNAdapterEventWait,
|
||||
OpenVPNAdapterEventWaitProxy,
|
||||
OpenVPNAdapterEventConnecting,
|
||||
OpenVPNAdapterEventGetConfig,
|
||||
OpenVPNAdapterEventAssignIP,
|
||||
OpenVPNAdapterEventAddRoutes,
|
||||
OpenVPNAdapterEventEcho,
|
||||
OpenVPNAdapterEventInfo,
|
||||
OpenVPNAdapterEventPause,
|
||||
OpenVPNAdapterEventResume,
|
||||
OpenVPNAdapterEventRelay,
|
||||
OpenVPNAdapterEventUnknown
|
||||
};
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// OpenVPNClient+Internal.h
|
||||
// OpenVPN iOS Client
|
||||
// OpenVPNClient.h
|
||||
// OpenVPN Adapter
|
||||
//
|
||||
// Created by Sergey Abramchuk on 11.02.17.
|
||||
//
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// OpenVPNClient.m
|
||||
// OpenVPN iOS Client
|
||||
// OpenVPN Adapter
|
||||
//
|
||||
// Created by Sergey Abramchuk on 11.02.17.
|
||||
//
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// OpenVPNError.h
|
||||
// OpenVPN iOS Client
|
||||
// OpenVPN Adapter
|
||||
//
|
||||
// Created by Sergey Abramchuk on 11.02.17.
|
||||
//
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
//
|
||||
// ClientEvent.h
|
||||
// OpenVPN NEF Test
|
||||
//
|
||||
// Created by Sergey Abramchuk on 05.11.16.
|
||||
// Copyright © 2016 ss-abramchuk. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
/**
|
||||
OpenVPN event codes
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, OpenVPNEvent) {
|
||||
OpenVPNEventDisconnected,
|
||||
OpenVPNEventConnected,
|
||||
OpenVPNEventReconnecting,
|
||||
OpenVPNEventResolve,
|
||||
OpenVPNEventWait,
|
||||
OpenVPNEventWaitProxy,
|
||||
OpenVPNEventConnecting,
|
||||
OpenVPNEventGetConfig,
|
||||
OpenVPNEventAssignIP,
|
||||
OpenVPNEventAddRoutes,
|
||||
OpenVPNEventEcho,
|
||||
OpenVPNEventInfo,
|
||||
OpenVPNEventPause,
|
||||
OpenVPNEventResume,
|
||||
OpenVPNEventRelay,
|
||||
OpenVPNEventUnknown
|
||||
};
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// OpenVPNTunnelSettings.h
|
||||
// OpenVPN iOS Client
|
||||
// OpenVPN Adapter
|
||||
//
|
||||
// Created by Sergey Abramchuk on 26.02.17.
|
||||
//
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// OpenVPNTunnelSettings.m
|
||||
// OpenVPN iOS Client
|
||||
// OpenVPN Adapter
|
||||
//
|
||||
// Created by Sergey Abramchuk on 26.02.17.
|
||||
//
|
||||
|
||||
@@ -17,7 +17,7 @@ FOUNDATION_EXPORT const unsigned char OpenVPNAdapterVersionString[];
|
||||
// In this header, you should import all the public headers of your framework using statements like #import <OpenVPNAdapter/PublicHeader.h>
|
||||
|
||||
#import <OpenVPNAdapter/OpenVPNError.h>
|
||||
#import <OpenVPNAdapter/OpenVPNEvent.h>
|
||||
#import <OpenVPNAdapter/OpenVPNAdapterEvent.h>
|
||||
#import <OpenVPNAdapter/OpenVPNTransportProtocol.h>
|
||||
#import <OpenVPNAdapter/OpenVPNIPv6Preference.h>
|
||||
#import <OpenVPNAdapter/OpenVPNCompressionMode.h>
|
||||
|
||||
Reference in New Issue
Block a user