25 lines
415 B
Swift
25 lines
415 B
Swift
//
|
|
// ArpSnapshot.swift
|
|
// Tun
|
|
//
|
|
// Created by Codex on 2026/5/20.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
final class ArpSnapshot: Snapshot {
|
|
private let entries: [UInt32: Data]
|
|
|
|
init(entries: [UInt32: Data]) {
|
|
self.entries = entries
|
|
}
|
|
|
|
func lookup(_ ip: UInt32) -> Data? {
|
|
return self.entries[ip]
|
|
}
|
|
|
|
static func empty() -> ArpSnapshot {
|
|
return ArpSnapshot(entries: [:])
|
|
}
|
|
}
|