diff --git a/Tun/Punchnet/Concurrency/SDLAsyncTimerStream.swift b/Tun/Punchnet/Concurrency/SDLAsyncTimerStream.swift deleted file mode 100644 index 03f9fbe..0000000 --- a/Tun/Punchnet/Concurrency/SDLAsyncTimerStream.swift +++ /dev/null @@ -1,33 +0,0 @@ -// -// SDLAsyncTimerStream.swift -// Tun -// -// Created by 安礼成 on 2026/2/3. -// - -import Foundation - -class SDLAsyncTimerStream { - let timer: DispatchSourceTimer - let stream: AsyncStream - private let cont: AsyncStream.Continuation - - init() { - self.timer = DispatchSource.makeTimerSource(queue: .global()) - (stream, cont) = AsyncStream.makeStream(of: Void.self) - } - - func start(interval: DispatchTimeInterval) { - timer.schedule(deadline: .now(), repeating: interval) - timer.setEventHandler { [weak self] in - self?.cont.yield() - } - timer.resume() - } - - deinit { - self.cont.finish() - self.timer.cancel() - } - -} diff --git a/Tun/Punchnet/Inbound/PacketInboundProcessor.swift b/Tun/Punchnet/Inbound/PacketInboundProcessor.swift index 9ba880b..30d5065 100644 --- a/Tun/Punchnet/Inbound/PacketInboundProcessor.swift +++ b/Tun/Punchnet/Inbound/PacketInboundProcessor.swift @@ -8,6 +8,7 @@ import Foundation final class PacketInboundProcessor { + enum ProcessingAction { case sendARPReply(dstMac: Data, data: Data) case appendARP(ip: UInt32, mac: Data)