//
//  PathSnapshot.swift
//  punchnet
//
//  Created by 安礼成 on 2026/4/29.
//
import Foundation
import Network

struct SDLPathSnapshot: Equatable, Sendable {
    let status: NWPath.Status
    let isExpensive: Bool
    let isConstrained: Bool
    let supportsIPv4: Bool
    let supportsIPv6: Bool
    let supportsDNS: Bool
    let usesWiFi: Bool
    let usesWired: Bool
    let usesCellular: Bool

    init(_ path: NWPath) {
        self.status = path.status
        self.isExpensive = path.isExpensive
        self.isConstrained = path.isConstrained
        self.supportsIPv4 = path.supportsIPv4
        self.supportsIPv6 = path.supportsIPv6
        self.supportsDNS = path.supportsDNS
        self.usesWiFi = path.usesInterfaceType(.wifi)
        self.usesWired = path.usesInterfaceType(.wiredEthernet)
        self.usesCellular = path.usesInterfaceType(.cellular)
    }
}
