mirror of
https://github.com/deneraraujo/OpenVPNAdapter.git
synced 2026-02-11 00:00:08 +08:00
Clean up unnecessary methods and classes
This commit is contained in:
@@ -9,11 +9,11 @@
|
||||
/* Begin PBXBuildFile section */
|
||||
C90BAD311E73FF6C00DEFB32 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C90BAD301E73FF6C00DEFB32 /* SystemConfiguration.framework */; };
|
||||
C912BB251E7C3339002B9414 /* NetworkExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C912BB241E7C3339002B9414 /* NetworkExtension.framework */; };
|
||||
C98467A21EAA559B00272A9A /* local_vpn_server.ovpn in Resources */ = {isa = PBXBuildFile; fileRef = C98467A11EAA559B00272A9A /* local_vpn_server.ovpn */; };
|
||||
C98467A31EAA559B00272A9A /* local_vpn_server.ovpn in Resources */ = {isa = PBXBuildFile; fileRef = C98467A11EAA559B00272A9A /* local_vpn_server.ovpn */; };
|
||||
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, ); }; };
|
||||
C9BB47751E7171D900F3F98C /* TUNConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = C9BB47731E7171D900F3F98C /* TUNConfiguration.h */; };
|
||||
C9BB47761E7171D900F3F98C /* TUNConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = C9BB47741E7171D900F3F98C /* TUNConfiguration.m */; };
|
||||
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, ); }; };
|
||||
@@ -25,7 +25,6 @@
|
||||
C9BB47A21E7183DB00F3F98C /* Bundle.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9BB47A11E7183DB00F3F98C /* Bundle.swift */; };
|
||||
C9D2ABDB1EA20F99007EDF9D /* OpenVPNAdapter.mm in Sources */ = {isa = PBXBuildFile; fileRef = C9BB477E1E7173C700F3F98C /* OpenVPNAdapter.mm */; };
|
||||
C9D2ABDC1EA20F99007EDF9D /* OpenVPNClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = C9BB47781E7171ED00F3F98C /* OpenVPNClient.mm */; };
|
||||
C9D2ABDD1EA20F99007EDF9D /* TUNConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = C9BB47741E7171D900F3F98C /* TUNConfiguration.m */; };
|
||||
C9D2ABDE1EA20F99007EDF9D /* ovpncli.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C9FD92191E9A667600374FC4 /* ovpncli.cpp */; };
|
||||
C9D2ABE01EA20F99007EDF9D /* NetworkExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C912BB241E7C3339002B9414 /* NetworkExtension.framework */; };
|
||||
C9D2ABE11EA20F99007EDF9D /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C90BAD301E73FF6C00DEFB32 /* SystemConfiguration.framework */; };
|
||||
@@ -37,22 +36,9 @@
|
||||
C9D2ABE81EA20F99007EDF9D /* OpenVPNError.h in Headers */ = {isa = PBXBuildFile; fileRef = C9BB476F1E7171A100F3F98C /* OpenVPNError.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
C9D2ABE91EA20F99007EDF9D /* OpenVPNAdapter+Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = C9BB477C1E7173C700F3F98C /* OpenVPNAdapter+Internal.h */; };
|
||||
C9D2ABEA1EA20F99007EDF9D /* ovpncli.hpp in Headers */ = {isa = PBXBuildFile; fileRef = C9FD92181E9A667600374FC4 /* ovpncli.hpp */; };
|
||||
C9D2ABEB1EA20F99007EDF9D /* TUNConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = C9BB47731E7171D900F3F98C /* TUNConfiguration.h */; };
|
||||
C9D2ABF61EA212A3007EDF9D /* OpenVPNAdapterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9BB47901E71821A00F3F98C /* OpenVPNAdapterTests.swift */; };
|
||||
C9D2ABF71EA212A3007EDF9D /* Bundle.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9BB47A11E7183DB00F3F98C /* Bundle.swift */; };
|
||||
C9D2AC051EA214EA007EDF9D /* OpenVPNAdapter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C9D2ABF01EA20F99007EDF9D /* OpenVPNAdapter.framework */; };
|
||||
C9D2AC161EA23A40007EDF9D /* TUNFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = C9D2AC141EA23A40007EDF9D /* TUNFactory.h */; };
|
||||
C9D2AC171EA23A40007EDF9D /* TUNFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = C9D2AC141EA23A40007EDF9D /* TUNFactory.h */; };
|
||||
C9D2AC181EA23A40007EDF9D /* TUNFactory.mm in Sources */ = {isa = PBXBuildFile; fileRef = C9D2AC151EA23A40007EDF9D /* TUNFactory.mm */; };
|
||||
C9D2AC191EA23A40007EDF9D /* TUNFactory.mm in Sources */ = {isa = PBXBuildFile; fileRef = C9D2AC151EA23A40007EDF9D /* TUNFactory.mm */; };
|
||||
C9D2AC1B1EA23E65007EDF9D /* free_openvpn_udp_us.ovpn in Resources */ = {isa = PBXBuildFile; fileRef = C9D2AC1A1EA23E65007EDF9D /* free_openvpn_udp_us.ovpn */; };
|
||||
C9D2AC1C1EA23E65007EDF9D /* free_openvpn_udp_us.ovpn in Resources */ = {isa = PBXBuildFile; fileRef = C9D2AC1A1EA23E65007EDF9D /* free_openvpn_udp_us.ovpn */; };
|
||||
C9D2AC1D1EA23EDE007EDF9D /* free_openvpn_udp_us.ovpn in Resources */ = {isa = PBXBuildFile; fileRef = C9D2AC1A1EA23E65007EDF9D /* free_openvpn_udp_us.ovpn */; };
|
||||
C9D2AC1E1EA23EE0007EDF9D /* free_openvpn_udp_us.ovpn in Resources */ = {isa = PBXBuildFile; fileRef = C9D2AC1A1EA23E65007EDF9D /* free_openvpn_udp_us.ovpn */; };
|
||||
C9D2AC201EA23F81007EDF9D /* free_openvpn_udp_jp.ovpn in Resources */ = {isa = PBXBuildFile; fileRef = C9D2AC1F1EA23F81007EDF9D /* free_openvpn_udp_jp.ovpn */; };
|
||||
C9D2AC211EA23F81007EDF9D /* free_openvpn_udp_jp.ovpn in Resources */ = {isa = PBXBuildFile; fileRef = C9D2AC1F1EA23F81007EDF9D /* free_openvpn_udp_jp.ovpn */; };
|
||||
C9D2AC221EA23F81007EDF9D /* free_openvpn_udp_jp.ovpn in Resources */ = {isa = PBXBuildFile; fileRef = C9D2AC1F1EA23F81007EDF9D /* free_openvpn_udp_jp.ovpn */; };
|
||||
C9D2AC231EA23F81007EDF9D /* free_openvpn_udp_jp.ovpn in Resources */ = {isa = PBXBuildFile; fileRef = C9D2AC1F1EA23F81007EDF9D /* free_openvpn_udp_jp.ovpn */; };
|
||||
C9FD921A1E9A667600374FC4 /* ovpncli.hpp in Headers */ = {isa = PBXBuildFile; fileRef = C9FD92181E9A667600374FC4 /* ovpncli.hpp */; };
|
||||
C9FD921B1E9A667600374FC4 /* ovpncli.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C9FD92191E9A667600374FC4 /* ovpncli.cpp */; };
|
||||
/* End PBXBuildFile section */
|
||||
@@ -84,12 +70,11 @@
|
||||
C90BAD2F1E73FA7400DEFB32 /* Tests.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Tests.xcconfig; sourceTree = "<group>"; };
|
||||
C90BAD301E73FF6C00DEFB32 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
|
||||
C912BB241E7C3339002B9414 /* NetworkExtension.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NetworkExtension.framework; path = System/Library/Frameworks/NetworkExtension.framework; sourceTree = SDKROOT; };
|
||||
C98467A11EAA559B00272A9A /* local_vpn_server.ovpn */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = local_vpn_server.ovpn; sourceTree = "<group>"; };
|
||||
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>"; };
|
||||
C9BB47731E7171D900F3F98C /* TUNConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TUNConfiguration.h; sourceTree = "<group>"; };
|
||||
C9BB47741E7171D900F3F98C /* TUNConfiguration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TUNConfiguration.m; 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>"; };
|
||||
@@ -101,10 +86,6 @@
|
||||
C9BB47A11E7183DB00F3F98C /* Bundle.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Bundle.swift; sourceTree = "<group>"; };
|
||||
C9D2ABF01EA20F99007EDF9D /* OpenVPNAdapter.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = OpenVPNAdapter.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
C9D2ABFF1EA212A3007EDF9D /* OpenVPN Adapter macOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "OpenVPN Adapter macOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
C9D2AC141EA23A40007EDF9D /* TUNFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TUNFactory.h; sourceTree = "<group>"; };
|
||||
C9D2AC151EA23A40007EDF9D /* TUNFactory.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TUNFactory.mm; sourceTree = "<group>"; };
|
||||
C9D2AC1A1EA23E65007EDF9D /* free_openvpn_udp_us.ovpn */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = free_openvpn_udp_us.ovpn; sourceTree = "<group>"; };
|
||||
C9D2AC1F1EA23F81007EDF9D /* free_openvpn_udp_jp.ovpn */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = free_openvpn_udp_jp.ovpn; sourceTree = "<group>"; };
|
||||
C9FD92181E9A667600374FC4 /* ovpncli.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ovpncli.hpp; path = Vendors/openvpn/client/ovpncli.hpp; sourceTree = "<group>"; };
|
||||
C9FD92191E9A667600374FC4 /* ovpncli.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ovpncli.cpp; path = Vendors/openvpn/client/ovpncli.cpp; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
@@ -192,9 +173,19 @@
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
C9B376B71EA53CE700B7F423 /* Client */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
C9BB47771E7171ED00F3F98C /* OpenVPNClient.h */,
|
||||
C9BB47781E7171ED00F3F98C /* OpenVPNClient.mm */,
|
||||
);
|
||||
name = Client;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
C9BB475D1E71663A00F3F98C /* OpenVPN Adapter */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
C9B376B71EA53CE700B7F423 /* Client */,
|
||||
C9BB47671E7169F000F3F98C /* Adapter */,
|
||||
C9BB47641E7169AF00F3F98C /* Libraries */,
|
||||
C9BB47651E7169B700F3F98C /* Framework */,
|
||||
@@ -223,16 +214,10 @@
|
||||
children = (
|
||||
C9BB476F1E7171A100F3F98C /* OpenVPNError.h */,
|
||||
C9BB47701E7171A100F3F98C /* OpenVPNEvent.h */,
|
||||
C9BB47731E7171D900F3F98C /* TUNConfiguration.h */,
|
||||
C9BB47741E7171D900F3F98C /* TUNConfiguration.m */,
|
||||
C9BB47771E7171ED00F3F98C /* OpenVPNClient.h */,
|
||||
C9BB47781E7171ED00F3F98C /* OpenVPNClient.mm */,
|
||||
C9BB477B1E7173C700F3F98C /* OpenVPNAdapter.h */,
|
||||
C9BB477C1E7173C700F3F98C /* OpenVPNAdapter+Internal.h */,
|
||||
C9BB477D1E7173C700F3F98C /* OpenVPNAdapter+Public.h */,
|
||||
C9BB477E1E7173C700F3F98C /* OpenVPNAdapter.mm */,
|
||||
C9D2AC141EA23A40007EDF9D /* TUNFactory.h */,
|
||||
C9D2AC151EA23A40007EDF9D /* TUNFactory.mm */,
|
||||
);
|
||||
name = Adapter;
|
||||
sourceTree = "<group>";
|
||||
@@ -267,8 +252,7 @@
|
||||
C9BB479A1E71836100F3F98C /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
C9D2AC1A1EA23E65007EDF9D /* free_openvpn_udp_us.ovpn */,
|
||||
C9D2AC1F1EA23F81007EDF9D /* free_openvpn_udp_jp.ovpn */,
|
||||
C98467A11EAA559B00272A9A /* local_vpn_server.ovpn */,
|
||||
);
|
||||
path = Resources;
|
||||
sourceTree = "<group>";
|
||||
@@ -317,11 +301,9 @@
|
||||
C9BB477F1E7173C700F3F98C /* OpenVPNAdapter.h in Headers */,
|
||||
C9BB47601E71663A00F3F98C /* Umbrella-Header.h in Headers */,
|
||||
C9BB47811E7173C700F3F98C /* OpenVPNAdapter+Public.h in Headers */,
|
||||
C9D2AC161EA23A40007EDF9D /* TUNFactory.h in Headers */,
|
||||
C9BB47711E7171A100F3F98C /* OpenVPNError.h in Headers */,
|
||||
C9BB47801E7173C700F3F98C /* OpenVPNAdapter+Internal.h in Headers */,
|
||||
C9FD921A1E9A667600374FC4 /* ovpncli.hpp in Headers */,
|
||||
C9BB47751E7171D900F3F98C /* TUNConfiguration.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -334,11 +316,9 @@
|
||||
C9D2ABE51EA20F99007EDF9D /* OpenVPNAdapter.h in Headers */,
|
||||
C9D2ABE61EA20F99007EDF9D /* Umbrella-Header.h in Headers */,
|
||||
C9D2ABE71EA20F99007EDF9D /* OpenVPNAdapter+Public.h in Headers */,
|
||||
C9D2AC171EA23A40007EDF9D /* TUNFactory.h in Headers */,
|
||||
C9D2ABE81EA20F99007EDF9D /* OpenVPNError.h in Headers */,
|
||||
C9D2ABE91EA20F99007EDF9D /* OpenVPNAdapter+Internal.h in Headers */,
|
||||
C9D2ABEA1EA20F99007EDF9D /* ovpncli.hpp in Headers */,
|
||||
C9D2ABEB1EA20F99007EDF9D /* TUNConfiguration.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -471,8 +451,6 @@
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
C9D2AC1B1EA23E65007EDF9D /* free_openvpn_udp_us.ovpn in Resources */,
|
||||
C9D2AC201EA23F81007EDF9D /* free_openvpn_udp_jp.ovpn in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -480,8 +458,7 @@
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
C9D2AC1D1EA23EDE007EDF9D /* free_openvpn_udp_us.ovpn in Resources */,
|
||||
C9D2AC221EA23F81007EDF9D /* free_openvpn_udp_jp.ovpn in Resources */,
|
||||
C98467A21EAA559B00272A9A /* local_vpn_server.ovpn in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -489,8 +466,6 @@
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
C9D2AC1C1EA23E65007EDF9D /* free_openvpn_udp_us.ovpn in Resources */,
|
||||
C9D2AC211EA23F81007EDF9D /* free_openvpn_udp_jp.ovpn in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -498,8 +473,7 @@
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
C9D2AC1E1EA23EE0007EDF9D /* free_openvpn_udp_us.ovpn in Resources */,
|
||||
C9D2AC231EA23F81007EDF9D /* free_openvpn_udp_jp.ovpn in Resources */,
|
||||
C98467A31EAA559B00272A9A /* local_vpn_server.ovpn in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -541,10 +515,8 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
C9D2AC181EA23A40007EDF9D /* TUNFactory.mm in Sources */,
|
||||
C9BB47821E7173C700F3F98C /* OpenVPNAdapter.mm in Sources */,
|
||||
C9BB477A1E7171ED00F3F98C /* OpenVPNClient.mm in Sources */,
|
||||
C9BB47761E7171D900F3F98C /* TUNConfiguration.m in Sources */,
|
||||
C9FD921B1E9A667600374FC4 /* ovpncli.cpp in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@@ -562,10 +534,8 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
C9D2AC191EA23A40007EDF9D /* TUNFactory.mm in Sources */,
|
||||
C9D2ABDB1EA20F99007EDF9D /* OpenVPNAdapter.mm in Sources */,
|
||||
C9D2ABDC1EA20F99007EDF9D /* OpenVPNClient.mm in Sources */,
|
||||
C9D2ABDD1EA20F99007EDF9D /* TUNConfiguration.m in Sources */,
|
||||
C9D2ABDE1EA20F99007EDF9D /* ovpncli.cpp in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@@ -599,6 +569,7 @@
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = C90BAD2A1E73F5AF00DEFB32 /* Project.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
@@ -627,6 +598,7 @@
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = C90BAD2A1E73F5AF00DEFB32 /* Project.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
@@ -653,7 +625,6 @@
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = C90BAD2B1E73F69500DEFB32 /* Debug.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
@@ -702,7 +673,6 @@
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = C90BAD2C1E73F69500DEFB32 /* Release.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
@@ -851,7 +821,6 @@
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = C90BAD2B1E73F69500DEFB32 /* Debug.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
@@ -903,7 +872,6 @@
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = C90BAD2C1E73F69500DEFB32 /* Release.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
|
||||
@@ -14,23 +14,6 @@ using namespace openvpn;
|
||||
|
||||
@interface OpenVPNAdapter (Client)
|
||||
|
||||
- (BOOL)configureSockets;
|
||||
|
||||
- (BOOL)setRemoteAddress:(NSString *)address isIPv6:(BOOL)isIPv6;
|
||||
|
||||
- (BOOL)addLocalAddress:(NSString *)address prefixLength:(NSNumber *)prefixLength gateway:(NSString *)gateway isIPv6:(BOOL)isIPv6;
|
||||
|
||||
- (BOOL)defaultGatewayRerouteIPv4:(BOOL)rerouteIPv4 rerouteIPv6:(BOOL)rerouteIPv6;
|
||||
- (BOOL)addRoute:(NSString *)route prefixLength:(NSNumber *)prefixLength isIPv6:(BOOL)isIPv6;
|
||||
- (BOOL)excludeRoute:(NSString *)route prefixLength:(NSNumber *)prefixLength isIPv6:(BOOL)isIPv6;
|
||||
|
||||
- (BOOL)addDNSAddress:(NSString *)address isIPv6:(BOOL)isIPv6;
|
||||
- (BOOL)addSearchDomain:(NSString *)domain;
|
||||
|
||||
- (BOOL)setMTU:(NSNumber *)mtu;
|
||||
|
||||
- (NSInteger)establishTunnel;
|
||||
|
||||
- (void)handleEvent:(const ClientAPI::Event *)event;
|
||||
- (void)handleLog:(const ClientAPI::LogInfo *)log;
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
#import "OpenVPNError.h"
|
||||
#import "OpenVPNEvent.h"
|
||||
#import "OpenVPNClient.h"
|
||||
#import "TUNConfiguration.h"
|
||||
|
||||
#import "OpenVPNAdapter.h"
|
||||
#import "OpenVPNAdapter+Internal.h"
|
||||
@@ -37,255 +36,14 @@ NSString * const OpenVPNAdapterErrorEventKey = @"me.ss-abramchuk.openvpn-adapter
|
||||
|
||||
@property OpenVPNClient *vpnClient;
|
||||
|
||||
@property CFSocketRef vpnSocket;
|
||||
@property CFSocketRef tunSocket;
|
||||
|
||||
@property (strong, nonatomic) NSString *remoteAddress;
|
||||
|
||||
@property (strong, nonatomic) TUNConfiguration *tunConfigurationIPv6;
|
||||
@property (strong, nonatomic) TUNConfiguration *tunConfigurationIPv4;
|
||||
|
||||
@property (strong, nonatomic) NSMutableArray *searchDomains;
|
||||
|
||||
@property (strong, nonatomic) NSNumber *mtu;
|
||||
|
||||
@property (weak, nonatomic) id<OpenVPNAdapterPacketFlow> packetFlow;
|
||||
|
||||
- (void)readTUNPackets;
|
||||
- (void)readVPNData:(NSData *)data;
|
||||
- (NSString *)getSubnetFromPrefixLength:(NSNumber *)prefixLength;
|
||||
|
||||
@end
|
||||
|
||||
@implementation OpenVPNAdapter (Client)
|
||||
|
||||
#pragma mark Sockets Configuration
|
||||
|
||||
static void socketCallback(CFSocketRef socket, CFSocketCallBackType type, CFDataRef address, const void *data, void *info) {
|
||||
OpenVPNAdapter *adapter = (__bridge OpenVPNAdapter *)info;
|
||||
|
||||
switch (type) {
|
||||
case kCFSocketDataCallBack:
|
||||
[adapter readVPNData:(__bridge NSData *)data];
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)configureSockets {
|
||||
int sockets[2];
|
||||
if (socketpair(PF_LOCAL, SOCK_DGRAM, IPPROTO_IP, sockets) == -1) {
|
||||
NSLog(@"Failed to create a pair of connected sockets: %@", [NSString stringWithUTF8String:strerror(errno)]);
|
||||
return NO;
|
||||
}
|
||||
|
||||
CFSocketContext socketCtxt = {0, (__bridge void *)self, NULL, NULL, NULL};
|
||||
|
||||
self.vpnSocket = CFSocketCreateWithNative(kCFAllocatorDefault, sockets[0], kCFSocketDataCallBack, &socketCallback, &socketCtxt);
|
||||
self.tunSocket = CFSocketCreateWithNative(kCFAllocatorDefault, sockets[1], kCFSocketNoCallBack, NULL, NULL);
|
||||
|
||||
if (!self.vpnSocket || !self.tunSocket) {
|
||||
NSLog(@"Failed to create core foundation sockets from native sockets");
|
||||
return NO;
|
||||
}
|
||||
|
||||
CFRunLoopSourceRef tunSocketSource = CFSocketCreateRunLoopSource(kCFAllocatorDefault, self.vpnSocket, 0);
|
||||
CFRunLoopAddSource(CFRunLoopGetMain(), tunSocketSource, kCFRunLoopDefaultMode);
|
||||
|
||||
CFRelease(tunSocketSource);
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
#pragma mark TUN Configuration
|
||||
|
||||
- (BOOL)setRemoteAddress:(NSString *)address isIPv6:(BOOL)isIPv6 {
|
||||
if (address == nil) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
self.remoteAddress = address;
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)addLocalAddress:(NSString *)address prefixLength:(NSNumber *)prefixLength gateway:(NSString *)gateway isIPv6:(BOOL)isIPv6 {
|
||||
if (address == nil || prefixLength == nil) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
if (isIPv6) {
|
||||
if (!self.tunConfigurationIPv6.initialized) {
|
||||
self.tunConfigurationIPv6.initialized = YES;
|
||||
}
|
||||
|
||||
[self.tunConfigurationIPv6.localAddresses addObject:address];
|
||||
[self.tunConfigurationIPv6.prefixLengths addObject:prefixLength];
|
||||
} else {
|
||||
if (!self.tunConfigurationIPv4.initialized) {
|
||||
self.tunConfigurationIPv4.initialized = YES;
|
||||
}
|
||||
|
||||
[self.tunConfigurationIPv4.localAddresses addObject:address];
|
||||
[self.tunConfigurationIPv4.prefixLengths addObject:prefixLength];
|
||||
}
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)defaultGatewayRerouteIPv4:(BOOL)rerouteIPv4 rerouteIPv6:(BOOL)rerouteIPv6 {
|
||||
if (rerouteIPv6) {
|
||||
NEIPv6Route *includedRoute = [NEIPv6Route defaultRoute];
|
||||
[self.tunConfigurationIPv6.includedRoutes addObject:includedRoute];
|
||||
}
|
||||
|
||||
if (rerouteIPv4) {
|
||||
NEIPv4Route *includedRoute = [NEIPv4Route defaultRoute];
|
||||
[self.tunConfigurationIPv4.includedRoutes addObject:includedRoute];
|
||||
}
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)addRoute:(NSString *)route prefixLength:(NSNumber *)prefixLength isIPv6:(BOOL)isIPv6 {
|
||||
if (route == nil || prefixLength == nil) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
if (isIPv6) {
|
||||
NEIPv6Route *includedRoute = [[NEIPv6Route alloc] initWithDestinationAddress:route networkPrefixLength:prefixLength];
|
||||
[self.tunConfigurationIPv6.includedRoutes addObject:includedRoute];
|
||||
} else {
|
||||
NSString *subnet = [self getSubnetFromPrefixLength:prefixLength];
|
||||
NEIPv4Route *includedRoute = [[NEIPv4Route alloc] initWithDestinationAddress:route subnetMask:subnet];
|
||||
[self.tunConfigurationIPv4.includedRoutes addObject:includedRoute];
|
||||
}
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)excludeRoute:(NSString *)route prefixLength:(NSNumber *)prefixLength isIPv6:(BOOL)isIPv6 {
|
||||
if (route == nil || prefixLength == nil) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
if (isIPv6) {
|
||||
NEIPv6Route *excludedRoute = [[NEIPv6Route alloc] initWithDestinationAddress:route networkPrefixLength:prefixLength];
|
||||
[self.tunConfigurationIPv6.excludedRoutes addObject:excludedRoute];
|
||||
} else {
|
||||
NSString *subnet = [self getSubnetFromPrefixLength:prefixLength];
|
||||
NEIPv4Route *excludedRoute = [[NEIPv4Route alloc] initWithDestinationAddress:route subnetMask:subnet];
|
||||
[self.tunConfigurationIPv4.excludedRoutes addObject:excludedRoute];
|
||||
}
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)addDNSAddress:(NSString *)address isIPv6:(BOOL)isIPv6 {
|
||||
if (address == nil) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
if (isIPv6) {
|
||||
[self.tunConfigurationIPv6.dnsAddresses addObject:address];
|
||||
} else {
|
||||
[self.tunConfigurationIPv4.dnsAddresses addObject:address];
|
||||
}
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)addSearchDomain:(NSString *)domain {
|
||||
if (domain == nil) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
[self.searchDomains addObject:domain];
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)setMTU:(NSNumber *)mtu {
|
||||
self.mtu = mtu;
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (NSInteger)establishTunnel {
|
||||
NSAssert(self.delegate != nil, @"delegate property should not be nil");
|
||||
|
||||
NEPacketTunnelNetworkSettings *networkSettings = [[NEPacketTunnelNetworkSettings alloc] initWithTunnelRemoteAddress:self.remoteAddress];
|
||||
|
||||
// Configure IPv6 addresses and routes
|
||||
if (self.tunConfigurationIPv6.initialized) {
|
||||
NEIPv6Settings *settingsIPv6 = [[NEIPv6Settings alloc] initWithAddresses:self.tunConfigurationIPv6.localAddresses networkPrefixLengths:self.tunConfigurationIPv6.prefixLengths];
|
||||
settingsIPv6.includedRoutes = self.tunConfigurationIPv6.includedRoutes;
|
||||
settingsIPv6.excludedRoutes = self.tunConfigurationIPv6.excludedRoutes;
|
||||
|
||||
networkSettings.IPv6Settings = settingsIPv6;
|
||||
}
|
||||
|
||||
// Configure IPv4 addresses and routes
|
||||
if (self.tunConfigurationIPv4.initialized) {
|
||||
NSMutableArray *subnets = [NSMutableArray new];
|
||||
[self.tunConfigurationIPv4.prefixLengths enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
NSString *subnet = [self getSubnetFromPrefixLength:obj];
|
||||
[subnets addObject:subnet];
|
||||
}];
|
||||
|
||||
NEIPv4Settings *ipSettings = [[NEIPv4Settings alloc] initWithAddresses:self.tunConfigurationIPv4.localAddresses subnetMasks:subnets];
|
||||
ipSettings.includedRoutes = self.tunConfigurationIPv4.includedRoutes;
|
||||
ipSettings.excludedRoutes = self.tunConfigurationIPv4.excludedRoutes;
|
||||
|
||||
networkSettings.IPv4Settings = ipSettings;
|
||||
}
|
||||
|
||||
// Configure DNS addresses and search domains
|
||||
NSMutableArray *dnsAddresses = [NSMutableArray new];
|
||||
|
||||
if (self.tunConfigurationIPv6.dnsAddresses.count > 0) {
|
||||
[dnsAddresses addObjectsFromArray:self.tunConfigurationIPv6.dnsAddresses];
|
||||
}
|
||||
|
||||
if (self.tunConfigurationIPv4.dnsAddresses.count > 0) {
|
||||
[dnsAddresses addObjectsFromArray:self.tunConfigurationIPv4.dnsAddresses];
|
||||
}
|
||||
|
||||
if (dnsAddresses.count > 0) {
|
||||
networkSettings.DNSSettings = [[NEDNSSettings alloc] initWithServers:dnsAddresses];
|
||||
}
|
||||
|
||||
if (networkSettings.DNSSettings && self.searchDomains.count > 0) {
|
||||
networkSettings.DNSSettings.searchDomains = self.searchDomains;
|
||||
}
|
||||
|
||||
// Set MTU
|
||||
networkSettings.MTU = self.mtu;
|
||||
|
||||
// Establish TUN interface
|
||||
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
|
||||
|
||||
[self.delegate configureTunnelWithSettings:networkSettings callback:^(id<OpenVPNAdapterPacketFlow> _Nullable flow) {
|
||||
self.packetFlow = flow;
|
||||
dispatch_semaphore_signal(sema);
|
||||
}];
|
||||
|
||||
// Wait 10 seconds
|
||||
dispatch_time_t timeout = dispatch_time(DISPATCH_TIME_NOW, 10 * NSEC_PER_SEC);
|
||||
if (dispatch_semaphore_wait(sema, timeout) != 0) {
|
||||
NSLog(@"Failed to establish tunnel in a reasonable time");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (self.packetFlow) {
|
||||
[self readTUNPackets];
|
||||
return CFSocketGetNative(self.tunSocket);
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark Event and Log Handlers
|
||||
|
||||
- (void)handleEvent:(const ClientAPI::Event *)event {
|
||||
@@ -365,7 +123,7 @@ static void socketCallback(CFSocketRef socket, CFSocketCallBackType type, CFData
|
||||
|
||||
@implementation OpenVPNAdapter (Provider)
|
||||
|
||||
#pragma mark Properties Gettters/Setters
|
||||
#pragma mark Properties
|
||||
|
||||
- (void)setUsername:(NSString *)username {
|
||||
_username = username;
|
||||
@@ -398,7 +156,7 @@ static void socketCallback(CFSocketRef socket, CFSocketCallBackType type, CFData
|
||||
|
||||
if (vpnConfiguration == nil) {
|
||||
if (error) *error = [NSError errorWithDomain:OpenVPNAdapterErrorDomain code:OpenVPNErrorConfigurationFailure userInfo:@{
|
||||
NSLocalizedDescriptionKey: @"Failed to read VPN configuration"
|
||||
NSLocalizedDescriptionKey: @"Failed to read OpenVPN configuration file"
|
||||
}];
|
||||
return NO;
|
||||
}
|
||||
@@ -416,7 +174,7 @@ static void socketCallback(CFSocketRef socket, CFSocketCallBackType type, CFData
|
||||
}
|
||||
|
||||
ClientAPI::ProvideCreds creds;
|
||||
creds.username = self.username == nil? "" : [self.username UTF8String];
|
||||
creds.username = self.username == nil ? "" : [self.username UTF8String];
|
||||
creds.password = self.password == nil ? "" : [self.password UTF8String];
|
||||
|
||||
ClientAPI::Status creds_status = self.vpnClient->provide_creds(creds);
|
||||
@@ -436,11 +194,6 @@ static void socketCallback(CFSocketRef socket, CFSocketCallBackType type, CFData
|
||||
// TODO: Describe why we use async invocation here
|
||||
dispatch_queue_t connectQueue = dispatch_queue_create("me.ss-abramchuk.openvpn-ios-client.connection", NULL);
|
||||
dispatch_async(connectQueue, ^{
|
||||
self.tunConfigurationIPv6 = [TUNConfiguration new];
|
||||
self.tunConfigurationIPv4 = [TUNConfiguration new];
|
||||
|
||||
self.searchDomains = [NSMutableArray new];
|
||||
|
||||
OpenVPNClient::init_process();
|
||||
|
||||
try {
|
||||
@@ -463,25 +216,6 @@ static void socketCallback(CFSocketRef socket, CFSocketCallBackType type, CFData
|
||||
}
|
||||
|
||||
OpenVPNClient::uninit_process();
|
||||
|
||||
self.remoteAddress = nil;
|
||||
|
||||
self.tunConfigurationIPv6 = nil;
|
||||
self.tunConfigurationIPv4 = nil;
|
||||
|
||||
self.searchDomains = nil;
|
||||
|
||||
self.mtu = nil;
|
||||
|
||||
if (self.vpnSocket) {
|
||||
CFSocketInvalidate(self.vpnSocket);
|
||||
CFRelease(self.vpnSocket);
|
||||
}
|
||||
|
||||
if (self.tunSocket) {
|
||||
CFSocketInvalidate(self.tunSocket);
|
||||
CFRelease(self.tunSocket);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -508,50 +242,6 @@ static void socketCallback(CFSocketRef socket, CFSocketCallBackType type, CFData
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark TUN -> OpenVPN
|
||||
|
||||
- (void)readTUNPackets {
|
||||
[self.packetFlow readPacketsWithCompletionHandler:^(NSArray<NSData *> * _Nonnull packets, NSArray<NSNumber *> * _Nonnull protocols) {
|
||||
[packets enumerateObjectsUsingBlock:^(NSData * data, NSUInteger idx, BOOL * stop) {
|
||||
// Prepend data with network protocol. It should be done because OpenVPN uses uint32_t prefixes containing network protocol.
|
||||
NSNumber *protocol = protocols[idx];
|
||||
uint32_t prefix = CFSwapInt32HostToBig((uint32_t)[protocol unsignedIntegerValue]);
|
||||
|
||||
NSMutableData *packet = [NSMutableData new];
|
||||
[packet appendBytes:&prefix length:sizeof(prefix)];
|
||||
[packet appendData:packet];
|
||||
|
||||
// Send data to the VPN server
|
||||
CFSocketSendData(self.vpnSocket, NULL, (CFDataRef)packet, 0.05);
|
||||
}];
|
||||
|
||||
[self readTUNPackets];
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark OpenVPN -> TUN
|
||||
|
||||
- (void)readVPNData:(NSData *)data {
|
||||
// Get network protocol from data
|
||||
NSUInteger prefixSize = sizeof(uint32_t);
|
||||
|
||||
if (data.length < prefixSize) {
|
||||
NSLog(@"Incorrect OpenVPN packet size");
|
||||
return;
|
||||
}
|
||||
|
||||
uint32_t protocol = UINT32_MAX;
|
||||
[data getBytes:&protocol length:prefixSize];
|
||||
|
||||
protocol = CFSwapInt32BigToHost(protocol);
|
||||
|
||||
// Send the packet to the TUN interface
|
||||
NSData *packet = [data subdataWithRange:NSMakeRange(prefixSize, data.length - prefixSize)];
|
||||
if (![self.packetFlow writePackets:@[packet] withProtocols:@[@(protocol)]]) {
|
||||
NSLog(@"Failed to send OpenVPN packet to the TUN interface");
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark Utils
|
||||
|
||||
- (NSString *)getSubnetFromPrefixLength:(NSNumber *)prefixLength {
|
||||
|
||||
@@ -6,55 +6,20 @@
|
||||
//
|
||||
//
|
||||
|
||||
#import <openvpn/tun/client/tunbase.hpp>
|
||||
#import <client/ovpncli.hpp>
|
||||
|
||||
using namespace openvpn;
|
||||
|
||||
class OpenVPNClient : public ClientAPI::OpenVPNClient
|
||||
class OpenVPNClient : public ClientAPI::OpenVPNClient, public TunClientFactory
|
||||
{
|
||||
public:
|
||||
OpenVPNClient(void * adapter);
|
||||
OpenVPNClient(void* adapter);
|
||||
|
||||
virtual TunClientFactory* new_tun_factory(const ExternalTun::Config& conf, const OptionList& opt) override;
|
||||
|
||||
virtual bool tun_builder_new() override;
|
||||
|
||||
virtual bool tun_builder_set_remote_address(const std::string& address, bool ipv6) override;
|
||||
virtual bool tun_builder_add_address(const std::string& address,
|
||||
int prefix_length,
|
||||
const std::string& gateway,
|
||||
bool ipv6,
|
||||
bool net30) override;
|
||||
virtual bool tun_builder_reroute_gw(bool ipv4,
|
||||
bool ipv6,
|
||||
unsigned int flags) override;
|
||||
virtual bool tun_builder_add_route(const std::string& address,
|
||||
int prefix_length,
|
||||
int metric,
|
||||
bool ipv6) override;
|
||||
virtual bool tun_builder_exclude_route(const std::string& address,
|
||||
int prefix_length,
|
||||
int metric,
|
||||
bool ipv6) override;
|
||||
virtual bool tun_builder_add_dns_server(const std::string& address, bool ipv6) override;
|
||||
virtual bool tun_builder_add_search_domain(const std::string& domain) override;
|
||||
virtual bool tun_builder_set_mtu(int mtu) override;
|
||||
virtual bool tun_builder_set_session_name(const std::string& name) override;
|
||||
virtual bool tun_builder_add_proxy_bypass(const std::string& bypass_host) override;
|
||||
virtual bool tun_builder_set_proxy_auto_config_url(const std::string& url) override;
|
||||
virtual bool tun_builder_set_proxy_http(const std::string& host, int port) override;
|
||||
virtual bool tun_builder_set_proxy_https(const std::string& host, int port) override;
|
||||
virtual bool tun_builder_add_wins_server(const std::string& address) override;
|
||||
|
||||
virtual int tun_builder_establish() override;
|
||||
|
||||
virtual bool tun_builder_persist() override;
|
||||
virtual void tun_builder_establish_lite() override;
|
||||
|
||||
virtual void tun_builder_teardown(bool disconnect) override;
|
||||
virtual TunClient::Ptr new_tun_client_obj(openvpn_io::io_context& io_context, TunClientParent& parent, TransportClient* transcli) override;
|
||||
|
||||
virtual bool socket_protect(int socket) override;
|
||||
|
||||
virtual bool pause_on_connection_timeout() override;
|
||||
|
||||
virtual void external_pki_cert_request(ClientAPI::ExternalPKICertRequest& certreq) override;
|
||||
@@ -64,7 +29,5 @@ public:
|
||||
virtual void log(const ClientAPI::LogInfo& log) override;
|
||||
|
||||
private:
|
||||
std::string get_subnet(int prefix_length);
|
||||
|
||||
void *adapter;
|
||||
void* adapter;
|
||||
};
|
||||
|
||||
@@ -10,118 +10,37 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "TUNFactory.h"
|
||||
#import "OpenVPNAdapter+Internal.h"
|
||||
#import "OpenVPNClient.h"
|
||||
|
||||
OpenVPNClient::OpenVPNClient(void *adapter) : ClientAPI::OpenVPNClient() {
|
||||
OpenVPNClient::OpenVPNClient(void* adapter) : ClientAPI::OpenVPNClient() {
|
||||
this->adapter = adapter;
|
||||
}
|
||||
|
||||
TunClientFactory* OpenVPNClient::new_tun_factory(const ExternalTun::Config& conf, const OptionList& opt) {
|
||||
return new TUNFactory();
|
||||
return this;
|
||||
}
|
||||
|
||||
bool OpenVPNClient::tun_builder_new() {
|
||||
return [(__bridge OpenVPNAdapter *)adapter configureSockets];
|
||||
}
|
||||
|
||||
bool OpenVPNClient::tun_builder_set_remote_address(const std::string &address, bool ipv6) {
|
||||
NSString *remoteAddress = [NSString stringWithUTF8String:address.c_str()];
|
||||
return [(__bridge OpenVPNAdapter *)adapter setRemoteAddress:remoteAddress isIPv6:ipv6];
|
||||
}
|
||||
|
||||
bool OpenVPNClient::tun_builder_add_address(const std::string &address, int prefix_length, const std::string &gateway, bool ipv6, bool net30) {
|
||||
NSString *localAddress = [NSString stringWithUTF8String:address.c_str()];
|
||||
NSString *gatewayAddress = [NSString stringWithUTF8String:gateway.c_str()];
|
||||
|
||||
return [(__bridge OpenVPNAdapter *)adapter addLocalAddress:localAddress prefixLength:@(prefix_length) gateway:gatewayAddress isIPv6:ipv6];
|
||||
}
|
||||
|
||||
bool OpenVPNClient::tun_builder_reroute_gw(bool ipv4, bool ipv6, unsigned int flags) {
|
||||
return [(__bridge OpenVPNAdapter *)adapter defaultGatewayRerouteIPv4:ipv4 rerouteIPv6:ipv6];
|
||||
}
|
||||
|
||||
bool OpenVPNClient::tun_builder_add_route(const std::string& address, int prefix_length, int metric, bool ipv6) {
|
||||
NSString *route = [NSString stringWithUTF8String:address.c_str()];
|
||||
return [(__bridge OpenVPNAdapter *)adapter addRoute:route prefixLength:@(prefix_length) isIPv6:ipv6];
|
||||
}
|
||||
|
||||
bool OpenVPNClient::tun_builder_exclude_route(const std::string& address, int prefix_length, int metric, bool ipv6) {
|
||||
NSString *route = [NSString stringWithUTF8String:address.c_str()];
|
||||
return [(__bridge OpenVPNAdapter *)adapter excludeRoute:route prefixLength:@(prefix_length) isIPv6:ipv6];
|
||||
}
|
||||
|
||||
bool OpenVPNClient::tun_builder_add_dns_server(const std::string& address, bool ipv6) {
|
||||
NSString *dnsAddress = [NSString stringWithUTF8String:address.c_str()];
|
||||
return [(__bridge OpenVPNAdapter *)adapter addDNSAddress:dnsAddress isIPv6:ipv6];
|
||||
}
|
||||
|
||||
bool OpenVPNClient::tun_builder_add_search_domain(const std::string& domain) {
|
||||
NSString *searchDomain = [NSString stringWithUTF8String:domain.c_str()];
|
||||
return [(__bridge OpenVPNAdapter *)adapter addSearchDomain:searchDomain];
|
||||
}
|
||||
|
||||
bool OpenVPNClient::tun_builder_set_mtu(int mtu) {
|
||||
return [(__bridge OpenVPNAdapter *)adapter setMTU:@(mtu)];
|
||||
}
|
||||
|
||||
bool OpenVPNClient::tun_builder_set_session_name(const std::string& name) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OpenVPNClient::tun_builder_add_proxy_bypass(const std::string& bypass_host) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OpenVPNClient::tun_builder_set_proxy_auto_config_url(const std::string& url) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OpenVPNClient::tun_builder_set_proxy_http(const std::string& host, int port) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OpenVPNClient::tun_builder_set_proxy_https(const std::string& host, int port) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OpenVPNClient::tun_builder_add_wins_server(const std::string& address) {
|
||||
return true;
|
||||
}
|
||||
|
||||
int OpenVPNClient::tun_builder_establish() {
|
||||
return (int)[(__bridge OpenVPNAdapter *)adapter establishTunnel];
|
||||
}
|
||||
|
||||
bool OpenVPNClient::tun_builder_persist() {
|
||||
return true;
|
||||
}
|
||||
|
||||
void OpenVPNClient::tun_builder_establish_lite() {
|
||||
|
||||
}
|
||||
|
||||
void OpenVPNClient::tun_builder_teardown(bool disconnect) {
|
||||
|
||||
TunClient::Ptr OpenVPNClient::new_tun_client_obj(openvpn_io::io_context& io_context, TunClientParent& parent, TransportClient* transcli) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool OpenVPNClient::socket_protect(int socket) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// TODO: Provide interfacing with an OS-layer Keychain
|
||||
void OpenVPNClient::external_pki_cert_request(ClientAPI::ExternalPKICertRequest& certreq) { }
|
||||
void OpenVPNClient::external_pki_sign_request(ClientAPI::ExternalPKISignRequest& signreq) { }
|
||||
|
||||
bool OpenVPNClient::pause_on_connection_timeout() {
|
||||
return false;
|
||||
}
|
||||
|
||||
// TODO: Provide interfacing with an OS-layer Keychain
|
||||
void OpenVPNClient::external_pki_cert_request(ClientAPI::ExternalPKICertRequest& certreq) { }
|
||||
void OpenVPNClient::external_pki_sign_request(ClientAPI::ExternalPKISignRequest& signreq) { }
|
||||
|
||||
void OpenVPNClient::event(const ClientAPI::Event& ev) {
|
||||
[(__bridge OpenVPNAdapter *)adapter handleEvent:&ev];
|
||||
[(__bridge OpenVPNAdapter* )adapter handleEvent:&ev];
|
||||
}
|
||||
|
||||
void OpenVPNClient::log(const ClientAPI::LogInfo& log) {
|
||||
[(__bridge OpenVPNAdapter *)adapter handleLog:&log];
|
||||
[(__bridge OpenVPNAdapter* )adapter handleLog:&log];
|
||||
}
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
//
|
||||
// TUNConfiguration.h
|
||||
// OpenVPN iOS Client
|
||||
//
|
||||
// Created by Sergey Abramchuk on 26.02.17.
|
||||
//
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface TUNConfiguration : NSObject
|
||||
|
||||
@property (nonatomic) BOOL initialized;
|
||||
|
||||
@property (readonly, strong, nonatomic) NSMutableArray *localAddresses;
|
||||
@property (readonly, strong, nonatomic) NSMutableArray *prefixLengths;
|
||||
|
||||
@property (readonly, strong, nonatomic) NSMutableArray *includedRoutes;
|
||||
@property (readonly, strong, nonatomic) NSMutableArray *excludedRoutes;
|
||||
|
||||
@property (readonly, strong, nonatomic) NSMutableArray *dnsAddresses;
|
||||
|
||||
@end
|
||||
@@ -1,30 +0,0 @@
|
||||
//
|
||||
// TUNConfiguration.m
|
||||
// OpenVPN iOS Client
|
||||
//
|
||||
// Created by Sergey Abramchuk on 26.02.17.
|
||||
//
|
||||
//
|
||||
|
||||
#import "TUNConfiguration.h"
|
||||
|
||||
@implementation TUNConfiguration
|
||||
|
||||
- (instancetype)init
|
||||
{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
_initialized = NO;
|
||||
|
||||
_localAddresses = [NSMutableArray new];
|
||||
_prefixLengths = [NSMutableArray new];
|
||||
|
||||
_includedRoutes = [NSMutableArray new];
|
||||
_excludedRoutes = [NSMutableArray new];
|
||||
|
||||
_dnsAddresses = [NSMutableArray new];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,18 +0,0 @@
|
||||
//
|
||||
// TUNFactory.h
|
||||
// OpenVPN Adapter
|
||||
//
|
||||
// Created by Sergey Abramchuk on 15.04.17.
|
||||
//
|
||||
//
|
||||
|
||||
#import <openvpn/tun/client/tunbase.hpp>
|
||||
|
||||
using namespace openvpn;
|
||||
|
||||
class TUNFactory: public TunClientFactory {
|
||||
public:
|
||||
virtual TunClient::Ptr new_tun_client_obj(openvpn_io::io_context& io_context,
|
||||
TunClientParent& parent,
|
||||
TransportClient* transcli) override;
|
||||
};
|
||||
@@ -1,18 +0,0 @@
|
||||
//
|
||||
// TUNFactory.m
|
||||
// OpenVPN Adapter
|
||||
//
|
||||
// Created by Sergey Abramchuk on 15.04.17.
|
||||
//
|
||||
//
|
||||
|
||||
#import "TUNFactory.h"
|
||||
|
||||
// !!! tuncli.hpp may be used as example of implementation
|
||||
|
||||
TunClient::Ptr TUNFactory::new_tun_client_obj(openvpn_io::io_context& io_context,
|
||||
TunClientParent& parent,
|
||||
TransportClient* transcli)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
Reference in New Issue
Block a user