Move frameworks from extemsion to host app

This commit is contained in:
Alex Kh 2022-02-23 18:57:06 +04:00
parent 8591d4e96c
commit b20e25f052
14 changed files with 172 additions and 138 deletions

View file

@ -3,19 +3,19 @@ import NetworkExtension
import Tun2socks
class AmneziaTun2SocksWriter: NSObject, Tun2socksTunWriterProtocol {
var tunnelFlow: NEPacketTunnelFlow
var tunnelFlow: NEPacketTunnelFlow
init( withPacketFlow nepflow: NEPacketTunnelFlow) {
self.tunnelFlow = nepflow
super.init()
}
init( withPacketFlow nepflow: NEPacketTunnelFlow) {
self.tunnelFlow = nepflow
super.init()
}
func write(_ p0: Data?, n: UnsafeMutablePointer<Int>?) throws {
if let packets = p0 {
tunnelFlow.writePackets([packets], withProtocols: [NSNumber(value: PF_INET)])
}
}
func write(_ p0: Data?, n: UnsafeMutablePointer<Int>?) throws {
if let packets = p0 {
tunnelFlow.writePackets([packets], withProtocols: [NSNumber(value: PF_INET)])
}
}
func close() throws {}
func close() throws {}
}