Posts

Post not yet marked as solved
6 Replies
533 Views
Hi, I'm interested in building a prototype swift app that can run on MacOS and IOS that can throttle both upload and download speeds. This would have to work along side an IKEv2 VPN connection which is controlled via the app (we have an existing app to manage the VPN connection built by an external team). I'm brand new to MacOS/IOS development apart from the beginner tutorials to build a basic app. It's fair to say I'm struggling a bit to know where to start. I've looked at Network Extensions and thought maybe I could add a sleep timer in between packets in App Proxy Provider or Packet Tunnel Provider but would that require me to write my own VPN client? I'm really just looking to add throttling capability for the existing IKEv2 connection managed by the app. We'd then get the user's bandwidth profile when they connect via our app, and set the throttling rate. I've checked out Network Link Conditioner and this is type of control I want to achieve in my app just with better accuracy. Cheers
Posted
by jason_s.
Last updated
.
Post not yet marked as solved
2 Replies
404 Views
Hi, When trying to activate a PacketTunnelProvider Network Extension in X-code on MacOS 13.3.1 (a) I get the following system logs: default 22:43:43.440691-0700 PacketTunnel Metal API Validation Enabled error 22:43:43.571295-0700 kernel Sandbox: PacketTunnel(46998) deny(1) mach-lookup com.apple.sysextd default 22:43:43.581295-0700 PacketTunnel ExtensionManager didFailWithError The operation couldn’t be completed. (OSSystemExtensionErrorDomain error 1.) Here is the Delegate I'm using: import Foundation import SystemExtensions import os.log class ExtensionManager : NSObject, OSSystemExtensionRequestDelegate { let identifier = "xx.xxxxxxx.PacketTunnel.PacketTunnelProvider" static let shared = ExtensionManager() static let log = OSLog(subsystem: "xx.xxxxxxx.PacketTunnel", category: "ExtensionManager") private let log: OSLog public override init() { self.log = Self.log os_log(.debug, log: self.log, "init") super.init() } func activate() { let activationRequest = OSSystemExtensionRequest.activationRequest(forExtensionWithIdentifier: identifier, queue: .main) activationRequest.delegate = self OSSystemExtensionManager.shared.submitRequest(activationRequest) } func deactivate() { let activationRequest = OSSystemExtensionRequest.deactivationRequest(forExtensionWithIdentifier: identifier, queue: .main) activationRequest.delegate = self OSSystemExtensionManager.shared.submitRequest(activationRequest) } func request(_ request: OSSystemExtensionRequest, actionForReplacingExtension existing: OSSystemExtensionProperties, withExtension replacement: OSSystemExtensionProperties) -> OSSystemExtensionRequest.ReplacementAction { os_log("ExtensionManager actionForReplacingExtension %@ %@", existing, replacement) return .replace } func requestNeedsUserApproval(_ request: OSSystemExtensionRequest) { os_log("ExtensionManager requestNeedsUserApproval") } func request(_ request: OSSystemExtensionRequest, didFinishWithResult result: OSSystemExtensionRequest.Result) { os_log("ExtensionManager didFinishWithResult %@", result.rawValue) } func request(_ request: OSSystemExtensionRequest, didFailWithError error: Error) { os_log("ExtensionManager didFailWithError %@", error.localizedDescription) } } And I'm running it via a basic View: import SwiftUI let minWidth: CGFloat = 180 let minHeight: CGFloat = 400 struct ContentView: View { var body: some View { VStack { Button(action: ExtensionManager.shared.activate) { Text("Activate") } Button(action: ExtensionManager.shared.deactivate) { Text("Deactivate") } Button(action: TunnelConfigurationService.shared.configure) { Text("Configure") } Button(action: TunnelConfigurationService.shared.start) { Text("Start") } } .padding() .frame(minWidth: minWidth, maxWidth: .infinity, minHeight: minHeight, maxHeight: .infinity) } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } } Any Ideas how to debug this further? I'm not sure how to proceed. Cheers
Posted
by jason_s.
Last updated
.