Post

Replies

Boosts

Views

Activity

Reply to Difference between PacketTunnelProvider and utun
Hi @meaton, One more clarification: Is my understanding correct for Apple's recommend approach, please correct me if I am wrong at any place: PacketTunnelProvider class in NetworkExtension framework can be used to activate and configure the utun interface. Now to define the network rules: either use "NEPacketTunnelNetworkSettings, ipv4Settings" settings or use "route add " command to route traffic on utun interface manually Now for tunneling IP-Packets, read/write operation can be directly done on the utun interface either by an app/service inside or outside the App Group. TIA
Topic: App & System Services SubTopic: Drivers Tags:
Jul ’22
Reply to How to pass parameter in Swift Async call
Found the fix for this. The sample testbed project for TransparentProxyProvider has synchronisation issue and is causing 'fatalError()' in 'extension Network.NWEndpoint', which causes crash of network extension. Fix for this synchronisation is to pass 'SupportFlow' as async argument:     if (supportedFlow != nil) {       self.queue.async { **[supportedFlow] in**         if (shouldBlock == true) {           // TODO with proper handling of flow           os_log(.debug, log: self.log, "TransparentProxy Provider want to block this TCP flow, flow: 0x%zx", flow.osLogID)           let error = NSError(domain: "", code: 0, userInfo: [NSLocalizedDescriptionKey : "Connection Refused"])           flow.closeReadWithError(error)           flow.closeWriteWithError(error)                     } else {           self.core.handleNewSupportedFlow(supportedFlow!, proxyServer!, proxyPort!)         }       }       os_log(.debug, log: self.log, "Provider did handle new flow, flow: 0x%zx", flow.osLogID)       return true     }
Topic: Programming Languages SubTopic: Swift Tags:
Sep ’22