ZitiTunnel
public class ZitiTunnel : NSObject, ZitiUnretained
Class providing a Swift wrapper for Ziti Tunnel SDK C
-
instance of Ziti that can be used for general purpose calls for performing operations, timers
Declaration
Swift
public let opsZiti: Ziti
-
Starting the tunnel will delay up to
SERVICE_WAIT_TIMEOUT
seconds waitig for services to be retrieved before calling theIdentitiesLoadedCallback
This is done to allow theZitiTunnelProvider
to configure any intercepted routes on the interface before it is started (important when extending anNEPacketTunnelProvider
)Declaration
Swift
public static var SERVICE_WAIT_TIMEOUT: Double
-
Type defintion of callback invoked when all identities have loaded (or timed-out)
Declaration
Swift
public typealias IdentitiesLoadedCallback = (_ error: ZitiError?) -> Void
-
Class encapsulating an IPv4 route
See moreDeclaration
Swift
public class Route : NSObject
-
Initialize a
ZitiTunnel
instanceDeclaration
Swift
public init(_ tunnelProvider:ZitiTunnelProvider?, _ ipAddress:String, _ subnetMask:String, _ ipDNS:String)
Parameters
tunnelProvider
Delegate for adding/removing routes, writing packets, and handling events
ipAddress
Address of the tunnel interface
subnetMask
Mask of the
ipAddress
for routes to the tunnel interfaceipDNS
Address for DNS queries
-
Set upstream DNS address
Declaration
Swift
public func setUpstreamDns(_ ipUpstreamDNS: String) -> Int32
Parameters
ipUpstreamDNS
hostname (and optional port) for upstream DNS requests
Return Value
Returns 0 on success
-
Perform on operation on the uv_loop managed by this class
Declaration
Swift
public func perform(_ op: @escaping Ziti.PerformCallback)
Parameters
op
operation to perform
-
Connect to Ziti and begin processing for the specified identites
Declaration
Swift
public func startZiti(_ zids: [ZitiIdentity], _ postureChecks: ZitiPostureChecks?, _ loadedCb: @escaping IdentitiesLoadedCallback)
Parameters
zids
List of Ziti identities
postureChecks
Handler for posture checks
loadedCb
Callback invoked when identites are loaded (services have been received or timed-out)
-
Shutdown Ziti
Declaration
Swift
public func shutdownZiti(_ completionHandler: @escaping () -> Void)
Parameters
completionHandler
Callback invoked when shutodwn compete
-
Queue a packet received from the tunnel interface for processing (e.g., for intercepted services or DNS requests)
Declaration
Swift
public func queuePacket(_ data: Data)
Parameters
data
IP packet received from the tunnel interface