mirror of
https://github.com/deneraraujo/OpenVPNAdapter.git
synced 2026-04-24 00:00:05 +08:00
Return connection info
This commit is contained in:
@@ -12,6 +12,7 @@
|
|||||||
@class OpenVPNConfiguration;
|
@class OpenVPNConfiguration;
|
||||||
@class OpenVPNProperties;
|
@class OpenVPNProperties;
|
||||||
@class OpenVPNCredentials;
|
@class OpenVPNCredentials;
|
||||||
|
@class OpenVPNConnectionInfo;
|
||||||
@class NEPacketTunnelNetworkSettings;
|
@class NEPacketTunnelNetworkSettings;
|
||||||
|
|
||||||
// TODO: Add documentation to properties and methods
|
// TODO: Add documentation to properties and methods
|
||||||
@@ -99,6 +100,12 @@ NS_SWIFT_NAME(handle(logMessage:));
|
|||||||
*/
|
*/
|
||||||
@property (weak, nonatomic, null_unspecified) id<OpenVPNAdapterDelegate> delegate;
|
@property (weak, nonatomic, null_unspecified) id<OpenVPNAdapterDelegate> delegate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Return information about the most recent connection. Will be available
|
||||||
|
after an event of type "CONNECTED, otherwise return nil
|
||||||
|
*/
|
||||||
|
@property (nullable, readonly, nonatomic) OpenVPNConnectionInfo *connectionInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
<#Description#>
|
<#Description#>
|
||||||
|
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ NSString * const OpenVPNAdapterErrorEventKey = @"me.ss-abramchuk.openvpn-adapter
|
|||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation OpenVPNAdapter (Provider)
|
@implementation OpenVPNAdapter (Public)
|
||||||
|
|
||||||
#pragma mark Properties
|
#pragma mark Properties
|
||||||
|
|
||||||
@@ -133,6 +133,12 @@ NSString * const OpenVPNAdapterErrorEventKey = @"me.ss-abramchuk.openvpn-adapter
|
|||||||
return _delegate;
|
return _delegate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (OpenVPNConnectionInfo *)connectionInfo {
|
||||||
|
// TODO: Check correctness of using "defined" property
|
||||||
|
ClientAPI::ConnectionInfo info = self.vpnClient->connection_info();
|
||||||
|
return info.defined ? [[OpenVPNConnectionInfo alloc] initWithConnectionInfo:info] : nil;
|
||||||
|
}
|
||||||
|
|
||||||
#pragma mark Client Configuration
|
#pragma mark Client Configuration
|
||||||
|
|
||||||
- (OpenVPNProperties *)applyConfiguration:(nonnull OpenVPNConfiguration *)configuration error:(out NSError * __nullable * __nullable)error {
|
- (OpenVPNProperties *)applyConfiguration:(nonnull OpenVPNConfiguration *)configuration error:(out NSError * __nullable * __nullable)error {
|
||||||
|
|||||||
Reference in New Issue
Block a user